|
You could use the CL CALL command to implement a very simple syntax
for "embedded SQL" in CL programs, like this:
CALL SQL PARM( SELECT DISTINCT * FROM 'QGPL/QAUOOPT' )
Leverage what the CALL command provides by writing a little "SQL"
program that concatenates all of its arguments, (e.g. using *BCAT),
to form the SQL query string to pass to your RUNSQL command (or the
one now provided by IBM.)
To ease the use of single-quotes, use a "special value" of *QUOTE,
that tells the SQL program to "en-quote" the next argument ... so in
this case:
CALL PGM(SQL) PARM( SELECT * FROM 'QGPL/QAUOOPT' +
WHERE OPTION = *QUOTE &OPT )
the value of &OPT will have single-quotes around it in the query
string.
<<SNIP>>
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.