Please explain "GenHdgsCSV" - is that part of SQL? Or how to build??

Thanks

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Tuesday, April 03, 2012 12:03 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Is there a better way to run SQL in a CL pgm?

On 03-Apr-2012 08:41 , Stone, Joel wrote:
" Not sure what the length of the field names has to do with the SQL
statement length for a statement used to generate a column heading
row for CSV, but..."

When building a list of field names, SQL stmts can get lengthy. The
longer each field name, the longer the SQL stmt.

Message . . . . : 11600 - RJSIMAGE/DOCSQL SQLSTM('insert into
qtemp/WORKHEADER values ( ''"Cust0001-Name","Cust0001-address-line1
"," Cust0001-address-line2","Cust0001-address-line3","CUST0001-CITY,"," ...


Yuck. All the more reason to generate them directly from the
catalogs. Encapsulated in a function [as a FETCH cursor instead of
recursive query even], the above request could become [and once again,
eliminating some escaped apostrophes]:

SQLSTM('insert into qtemp/WORKHEADER
values(GenHdgsCSV(FileName,LibName))') <===================================================???

Regards, Chuck

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].