kkmsmail Beginner
Joined: 13 Jun 2008 Posts: 1 Topics: 1
|
Posted: Mon Jun 16, 2008 2:01 am Post subject: convert DB2 Stored procedure |
|
|
How to I convert the DB2 stored procedure into an atomic script? The stored procedure is given below.
CREATE PROCEDURE ABCD.NEWINSERT()
LANGUAGE SQL
P1:BEGIN
DECLARE < few variables >
DECLARE C1 CURSOR FOR < select stmt with where
condition>
OPEN C1;
ins_loop: LOOP
FETCH C1 INTO < variables>
<SKIP LOOP LOGIC>
INSERT INTO functionname(list of columns) values (list of values)
END LOOP
CLOSE C1;
END P1 |
|