×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




sorry for not letting this go, but I'm curious if you could still "automatically" get the column names is you ran this:

select * from table (
qsys2.parse_statement('put your SQL in this space you''l have to add a quote to any single quotes in the SQL like field = ''ABC'' '));

https://www.ibm.com/docs/en/i/7.4?topic=services-parse-statement-table-function

I just ran across and tried on a couple of SQLs that I have that have joins.

Bryan

Greg Wilburn wrote on 2/28/2024 1:37 PM:
Thanks for the input, but that won't work in this case...

I'm doing a select of various fields from two SQL views that are joined.

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Bryan Dietz
Sent: Wednesday, February 28, 2024 2:26 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Re: CSVGEN?

I recall taking the file name being inputted and execute the following SQL to start the CSV creation process.

SELECT
LISTAGG(CAST(Qsys2.Delimit_Name(Column_Name) AS CLOB(1M)), ', ') WITHIN GROUP (ORDER BY Ordinal_Position) AS Column_List
FROM Qsys2.Syscolumns2 C
WHERE Table_Name = UPPER('QCUSTCDT')
AND Table_Schema = 'QIWS'
AND Hidden = 'N' ;

Greg Wilburn wrote on 2/28/2024 1:10 PM:
I thought it appropriate to start a different thread...I've moved on from systools.generate_spreadsheet.

Maybe this belongs in RPG forum?



I'm currently experimenting with Scott's CSVGEN using DATA-GEN, but I'm not sure how to get column headings using this method.

I was hoping it worked like YAJLDTAGEN that uses the DS names.



Anyone use this?

TIA,

Greg


[Logo]<https://www.totalbizfulfillment.com/> Greg Wilburn
Director of IT
301.895.3792 ext. 1231
301.895.3895 direct
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@totalbizfulfillment.c
om>
1 Corporate Dr
Grantsville, MD 21536
www.totalbizfulfillment.com<http://www.totalbizfulfillment.com>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.