|
Format the SQL statement so that it returns the record to you in a CSV(delimited) type way. One big long text string. Then you can either parse out the individual fields or write it directly to a 'PC' file on the IFS. -- Scott > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of > MEovino@xxxxxxxxxxxxxxxxx > Sent: Thursday, June 26, 2003 10:43 AM > To: rpg400-l@xxxxxxxxxxxx > Subject: Using SQL Fetch with an unknown number of columns > > > We have an app that uses a dynamically generated SQL > statement to query out > a set of records. Files, fields, sorts, etc. are stored in a > file, so we > have no way of knowing what the recordset will look like at > compile time. > Because of this, we're having problems using Fetch in any sort of > meaningful way. We know how to Fetch into a DS or a bunch of > variables, > but both seem to require knowing what the recordset looks > like at compile > time. If we have more variables in the Fetch Cursor Into > statement than we > have in the recordset, will this be a problem? > > All we want to do is dump the recordset into a work file so > we can export > that out to a PC file. Unfortunately we're still on V5R1, so > we don't have > Create Table As. > > Mike E. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.