Evan Harris wrote:
Hi Scott
If I use an RPG I now have to code and compile an additional program and
recompile every time I want to change my SQL. If I use a QM Query I simply
have to edit the QM Source member with the SQL statement.
Wouldn't you also have to recompile your QMQRY source the same way you 
recompile your RPG program?!?!  By your logic, RUNSQLSTM would be 
simpler, since it doesn't have to be compiled like QMQRY does...
Unless I'm confused, you have to run CRTQMQRY to compile a QM Query.
The QM Query approach is primitive but effective if you just want to run a
query - and it nicely externalises the SQL from the CL.
You're right...  I just re-read the original message.  I didn't notice 
the first time around that he wanted the results to go to a physical 
file!   I thought he wanted to read the results into variables in his CL 
program.
In that case, RUNSQLSTM or QMQRY would definitely be easier than using 
data queues.
however, I should point out that if you don't need to get the results in 
your CL program, you don't need to use a data queue, either...   the 
point behind the data queue was PURELY that you could get the input into 
your CL program via a data queue.
If the output is meant for a file, it's a simple SQL statement, and 
RUNSQLSTM, QM Query or STRQSH calling the db2 command would all be 
simple, but effective ways of doing this from CL.
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 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.