I'm not sure but I know I've run SQL from CL by putting it in a source file and using the runsqlstm command.
I'm not sure but I know I've run SQL from CL by putting it in a source file and using the runsqlstm command.
> Is there a way to embed SQL in CL other than OPNQRYF, > just like in RPG? If so how can I do it, whats the syntax. The quick answer is that you can't really do embedded SQL in CL 'just like in RPG.' A more convoluted answer is that you can run simple DDL scripts via IBM's RUNSQLSTM. You can also perform standalone SQL statements via Query Management Query (QMQRY). There are several QMQRY entries in the FAQ at http://faq.midrange.com. Search for QMQRY. The archives at http://archive.midrange.com have several contributions of some fairly generic 'command line' SQL processors, including RUNSQL. There are also several versions of this floating aroung the net. http://www.google.com can help you find them. The IBM manuals are at http://www.iseries.ibm.com/infocenter Hope that helped. --buck
Also see This forum post at the bottom for a RUNSQLSTM example.
There's also the SEQUEL product from Advanced Systems Concepts (asc-iseries.com).
The easiest way to run simple SELECT statement : RUNQRY *N YourLib/YourFile RCDSLT(*YES) Use F4 to prompt for options and record selection, it also gives summary(totals). It works like QRY400, but only one file could be used.
Is there a way to embed SQL in CL other than OPNQRYF, just like in RPG? If so how can I do it, whats the syntax. Thanks a lot. Sky