× 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.




I am trying to perform a FETCH into a DS, with that data structure being defined smaller DSs, each DS being the fields in a table that the SQL SELECT selects from.

Does anyone know if it is possible to do something like this:

D JL0099 E DS ExtName(JBTJL0099 : *ALL)
D JL0110 E DS ExtName(JBTJL0110 : *ALL)
D JL0120 E DS ExtName(JBTJL0120 : *ALL)

dcl-ds DS_ALL dim(100) qualified;
d1_ds likeds(jl0099);
d2_ds likeds(jl0110);
d3_ds likeds(jl0120);
end-ds;


then:

exec sql fetch from [cursor] for 100 rows into :ds_all

The SQL is a join of 4 tables, but I can't get this to compile. I get the "SQL0312 Variable DS_ALL not defined or not usable" error. Can you fetch into a DS of DSs?

Thank you,

Doug


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.