[Openroad-users] Importing data - Copy statement

Rob McKenzie rob_mckenzie59 at yahoo.ca
Fri Nov 3 02:25:53 EST 2006


Gareth,

Why can't you make liberal use of the d data type in the copy command to skip past the quotes that are
surrounding all of your data values!!

The d stands for dummy value..and allows you to read some data, but not load it into a column in a table... let me know if you need an example...
 
Rob McKenzie 
Phone: (905) 989-1750 
Cell:     (905) 715-9593 
Email:  rob.mckenzie at rogers.com



----- Original Message ----
From: "gareth.2.edwards at bt.com" <gareth.2.edwards at bt.com>
To: openroad-users at peerlessit.com
Sent: Thursday, November 2, 2006 10:02:36 AM
Subject: Re: [Openroad-users] Importing data - Copy statement


I feared as much, thanks for the response Karl. 

As a complete stab in the dark, is there such a thing as VIM scripts?,
that I could possibly execute one of those against the file, to do the
substitutions?


Cheers,
Gareth Edwards

BT Global Services 
tel: +44 (0)131 345 4671 
email: gareth.2.edwards at bt.com

-----Original Message-----
From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Karl & Betty
Schendel
Sent: Thursday, November 02, 2006 1:49 PM
To: International OpenROAD Users
Subject: Re: [Openroad-users] Importing data - Copy statement

At 10:55 AM +0000 11/2/06, <gareth.2.edwards at bt.com> wrote:
>OR4.1, Win2000
>
>Hi All,
>
>Having not done much with the copy statement previously, I'm a litle
lost.
>
>I have to import some data, the two formats available are:
>
>1) Comma seperated, but every data value is in "quotes"
>2) Tab delimited, money values greater than 999 are in "quotes" and 
>also contain a comma to break the thousand/hundred value
>
>Are there any ways to deal with these imports? In particular the quoted
values??

There's no nice way to do it with copy.  The copy statement doesn't
really understand quoted values.  If you were running on a real OS I
would have suggested going with the tabbed form, and using something
like sed to strip out the quotes and commas.
Unless you have an equivalent tool for windows available (e.g. sed in
cygwin32), I'd say that your idea of reading the moneys into varchars
and working with them there is probably best.

Karl
_______________________________________________
Openroad-users mailing list
Openroad-users at peerlessit.com
http://peerlessit.com/mailman/listinfo/openroad-users



_______________________________________________
Openroad-users mailing list
Openroad-users at peerlessit.com
http://peerlessit.com/mailman/listinfo/openroad-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://peerlessit.com/pipermail/openroad-users/attachments/20061102/bc6950e2/attachment.html 


More information about the Openroad-users mailing list