"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 03/04/2019
04:53:17 PM:
...snip... However, Run SQL Statements does not
execute the compound statement interactively. It compiles it into a
temporary object and apparently executes it in a new (or second level)
job
environment and that apparently does not handle the internal QCMDEXC
calls
the same way as when Run SQL Scripts executes QCMDEXC interactively.


Well, strike all that. I just tried it again and it seems to be
working just fine.


create type comp_array as char(5) array[10];

begin
declare comp comp_array;
declare idx,max integer;

set comp = array['00620','00621'];
set max = cardinality(comp);
set idx = 0;

array_loop:
Loop
set idx = idx + 1;
if idx > max then
leave array_loop;
end if;
call qsys2/qcmdexc('CALL UTSETLLCL (''' || comp[idx] || ''')');
call qsys2/qcmdexc('IMIOVEVAL CMDUSE(*MONTHEND)');
End Loop;

End;


Sincerely,

Dave Clark

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