oracle - execute several queries in one variable -
i have in variable ddl , dml queries.
example:
var1='insert tb1 (id) values(1); insert tb1 (id) values(2); insert tb1 (id) values(3);' i want execute var1 contains several inserts. how that? execute immediate didnt worked.
edit: tryd , didnt work because there ';' within it.
declare col_count number; begin execute immediate ('insert ex_employee (id) values (3); insert ex_employee (id) values (4);'); end; /
embed inserts begin-end anonymous block 1 below.
oracle document
declare col_count number; begin execute immediate 'begin insert ex_employee (id) values (3); insert ex_employee (id) values (4); end;'; exception when others --handle exception here. end; / oracle
No comments:
Post a Comment