× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You can create a view with the given Select statement, then just run a
CPYTOIMPF  over that view to create a stream file on IFS. Of course this
technique has some shortcomings, CPYTOIMPF cannot use a view with a join
clause.

Carlos K.

> -----Mensaje original-----
> De: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]En nombre de
> MEovino@xxxxxxxxxxxxxxxxx
> Enviado el: jueves, 26 de junio de 2003 17:43
> Para: rpg400-l@xxxxxxxxxxxx
> Asunto: 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.
>
>
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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.