Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Than One SQL Statement 2

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
0
0
US
Is there a way of coding more than one SQL statement to run in a file from CRTQMQRY/STRQMQRY commands?

I'm looking to code multiple INSERT and DELETE statements for different files in the same QQMQRYSRC file.


Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
IMHO it's not possible. In QM-Query you can have only one SQL-statement, i.e. for multiple SQL-statements you need to create multiple QM-Queries.

But you can code more than one SQL statements in a source member (by default it should be placed in a Source Physical File named QSQLSRC) and then run that SQL-member using RUNSQLSTMT.

I personally prefer to code rather embedded SQL in REXX/400. It enables better error treatment and using of additional logic.

 
If RUNSQLSTM,
1/ use semi-colon as separator at the end of each sql stm.
2/ you can NOT pass any parameters to the procedure : each stm must be hard-coded.
3/ the source file can have any name i.e.QSQLSRC is not mandatory.
4/ if parameters used, you'd be better off creating a HLL program.
 
OK, thanks chaps.



Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top