If the SQL statement never changes, then write it once in a source member and use RUNSQLSTM to execute it. If it needs to accept parameters then write it in QMQRY, or RPG/COBOL with embedded SQL, and pass whatever parms it needs. But...CL has no direct support for SQL without using some sort of add on tool. Did that help? Kevin
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
How to Execute SQL commands from within a CL pgm
Collapse
X
-
How to Execute SQL commands from within a CL pgm
Hi Birgitta, I thought the DB2 command in QShell was an undocumented utility for internal IBM developers. In other words, is there any guarantee that it will be supported on future releases of OS/400? If not, I think just passing a parm to an RPG program that does an EXECUTE IMMEDIATE would be a better solution. Regards, Chris
Comment
-
How to Execute SQL commands from within a CL pgm
If you're willing to go to the trouble of loading a utility, here is one that can help: http://www.mcpressonline.com/mc?1@17...onid=.5bfbaea4 The one benefit this utility can offer is the ability to easily retrieve the number of rows affected by an insert, update or delete statement.
Comment
Comment