|
Happy New Year to all.parameter
I need to open a cursor but the number of parameter markers is not known
until run time.
I'm doing this right now with a SELECT statement in RPG but wondering if
this can be softcoded in some way. What I have is...
// We now need to open the statsCursor with the correct number of
markers
Select;
When fileCount = 1;
Exec sql
OPEN statsCursor USING :fromTs, :toTs;
When fileCount = 2;
Exec sql
OPEN statsCursor USING :fromTs, :toTs, :fromTs, :toTs;
When fileCount = 3;
Exec sql
OPEN statsCursor USING :fromTs, :toTs, :fromTs, :toTs, :fromTs,
:toTs;
Endsl;
Currently this is coded for 3 files, but this can easily be 10 or more
files at run time.
Do I have any other options for OPENing the cursor?
Thanks,
Rob
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.