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



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 02/02/2017 11:01:26
AM:
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?

Unless there are recent changes in the SQL precompiler, what you
are attempting is not supported. It would require a 3-level qualified
reference and the SQL precompiler only supports 2 levels.

Sincerely,

Dave Clark

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.