Problem solve Get help with specific problems with your technologies, process and projects.

Running multiple SQL statements

Here you'll learn how to run more than one statement in a single source member.

You can run more than one statement in a single source member, just put a semicolon at the end of each statement -- except the last.


  

        *************** Beginning of data **************************
0131.91 INSERT INTO LYNNE/PGATSGRP SELECT * FROM AAFILES/PFGRPATS;  
0131.92 DELETE FROM LYNNE/PGATSGRP;                                 
0131.93 INSERT INTO LYNNE/PGATSGRP SELECT * FROM AAFILES/PFGRPATS   
        ****************** End of data *****************************

Then I executed the runsqlstm with commit(*none) and here are the results:
5722SS1 V5R1M0 010525               Run SQL Statements             TEST2STTT
03/11/04 08:31:2
 Record  *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6
...+... 7 ...+... 8   SEQNBR  Last change        
 MSG ID  SEV  RECORD  TEXT

 SQL7956   0       1  Position 1 5174 rows inserted in PGATSGRP in LYNNE.

 SQL0088   0       2  Position 1 DELETE applies to entire table.

 SQL7955   0       2  Position 1 5174 rows deleted from PGATSGRP in LYNNE.

 SQL7956   0       3  Position 1 5174 rows inserted in PGATSGRP in LYNNE.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close