Chuck,
I know cpytoimpf works great for database export - i'm struggling with what
to me is an inprecise wording in the vendor specs. From many google sources
I can see SQL Loader is heavily used for Oracle, but it seems the vendor has
their particular setup & config for SQL Loader and I'm trying meet those
requirements.
The vendor's example, in their own wording, is
<quote>
IF a legacy character string has imbedded special characters (e.g. commas or
double quotes) then surround the character string with a pair of double
quotes.
Further, each double quote character that is part of the legacy data must be
replaced by two double quotes.
Example: """This is a test, to show how ""quotes"" are handled"""
In this example, a leading and trailing quote exists in the legacy char
string, double quotes exist before and after the word quotes and a comma
exists after word test. </quote>
They also had a sample of data of the csv where there were no embedded
double quotes.
100438,1,720,SURREY LANE,,SLEEPY HOLLOW.....
So if the original value of field 2 is
"This is a test, to show how "quotes" are handled"
I tried cpytoimpf and I get the one field of the example looking ok, but
also get a double quote around every alpha field - which is not in the
example (and I know is normal cpytoimpf behavior).
"ABLE202","""THIS IS A TEST, TO SHOW HOW ""QUOTES"" HANDLED""","1201 E WEST
AVE", ...
There are some other reasons for the rpgle - we have to convert all
ampersands, underline, and percent characters to something else, plus
insert some formatting carriage return /^CR^/ in large text fields where we
want a carriage return for screen display or printing. Approx 70 files to
process this way.
Jim Franz
----- Original Message -----
From: "CRPence" <CRPbottle@xxxxxxxxx>
Newsgroups: midrange.midrange-l
To: <midrange-l@xxxxxxxxxxxx>
Sent: Sunday, March 28, 2010 9:58 PM
Subject: Re: write csv from iSeries for Oracle SQL Loader
Jim Franz wrote:
Have been asked to provide .csv files to send to an Oracle
Server. <<SNIP>>
I'm using RPGLE to write the file directly to the IFS (specs
have requirements for double quotes I can't get with a cpyto..
command.
<<SNIP>>
Since the CPYTOIMPF as database export feature actually defaults
to generate a comma separated values [i.e. comma as column\field
delimiter] with double quote character as delimiter for character
strings, a suggestion that a "cpyto.." command is not capable of
effecting exactly that, seems at least somewhat suspect.?
Regards, Chuck
As an Amazon Associate we earn from qualifying purchases.