If you check my GITHUB, you'll find an example how to read a *.csv file.
https://gist.github.com/BirgittaHauser
The example was written before we had the IFS_READ functions, so I used
GET_CLOB_FROM_FILE and split twice (into rows at CRLF and into columns).
With the IFS_READ functions only a single split is necessary.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Justin
Taylor
Sent: Freitag, 18. Juni 2021 20:09
To: MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: SQL to read CSV file
This may be a moot question, because it appears SYSTOOLS.SPLIT() can't
handle quoted strings (e.g. "LastName,FirstName").
1. select LINE from table(QSYS2.IFS_READ(PATH_NAME => '/tmp/Filename.csv',
END_OF_LINE => 'CRLF')) 2. Yes 3. No
Thanks
date: Thu, 17 Jun 2021 19:10:00 +0200
from: "Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
subject: RE: SQL to read CSV file
1. Can you show how you call IFS_READ, i.e. how your parameters are set?
2. Are CRLF characters included in the IFS File or not?
3. Can the IFS File split into rows depending on a predefined length?
Mit freundlichen Gr??en / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars."
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
them and keeping them!"
?Train people well enough so they can leave, treat them well enough so
they don't want to.? (Richard Branson)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.