How to run a set of SQL statements in AS400 [message #289353] |
Thu, 20 December 2007 21:48 |
sivakumar.oracle
Messages: 9 Registered: August 2007 Location: Bangalore
|
Junior Member |
|
|
HI Folks,
i was stuck at my work with this issue :
Created one member i.e, INS_INTF in CDC/SRC_CDC,where this member contains a set of SQL insert statements nearly about 116.I wanted to execute/run this in AS400.
can any body try to find out a solution for me.
My CL program :
CREATE PROCEDURE CDC/INS_TEST11()
LANGUAGE SQL
P1: BEGIN
INSERT INTO cdc/abc (select * from cdc/xyz);
INSERT INTO cdc/cde (select * from cdc/qrs);
"
"
:
116 inserts
END P1
Regards,
siva
|
|
|
|
Re: How to run a set of SQL statements in AS400 [message #307384 is a reply to message #289353] |
Tue, 18 March 2008 13:15 |
Tafer
Messages: 64 Registered: July 2005 Location: Here!
|
Member |
|
|
You can try this:
Change your INS_INTF to something simpler (only the insert statements):
INSERT INTO cdc/abc (select * from cdc/xyz);
INSERT INTO cdc/cde (select * from cdc/qrs);
...
And finally run it with this:
RUNSQLSTM SRCFILE(CDC/SRC_CDC) SRCMBR(INS_INTF) COMMIT(*NONE)
(The COMMIT(*NONE) may or may not be required)
I hope this helps.
Edit: My bad, I'm assuming you are using the integrated DB2. If that's not the case, this shouldn't work.
Re-Edit: Wow, didn't notice how long this question has been around. Sorry!
[Updated on: Tue, 18 March 2008 13:22] Report message to a moderator
|
|
|