|
passing array to embedded sql
I'd like to know if it's possible to insert multiple records with a single query. The values comes from an array of values.
let say, i have two arrays:
NAME[10]
AGE[10]
how do i loop 10 times to ADD the values to a DB2 table named TABLE2?
i have a code on how to add a single NAME & AGE.
SUBMIT SQL CONTINUE;
CONNECT TO DB2(SSID=&DB2ID);
EXECUTE(INSERT INTO &CREATOR.&TABLE2 (NAME, AGE)
VALUES('&NAME','&AGE')) BY DB2;
%PUT SQLXRC=&SQLXRC, SQLXMSG=&SQLXMSG;
%LET SQLDBRC=&SYSDBRC;
EXECUTE(COMMIT) BY DB2;
DISCONNECT FROM DB2;
QUIT;
ENDSUBMIT;
thanks!
|