I have a table as described below
SQL> desc tab_script
Name Null? Type
----------------------------------------- -------- ----------------------------
SRLNO NUMBER
INSERT_SCRIPT CLOB
insert_script is populated with insert statement. I want to execute insert script dynamically. I have written the following code, but does not work.
DECLARE
ln_type_id NUMBER:= 1;
lcl_sql clob;
BEGIN
FOR rec IN ( SELECT * FROM tab_script )
LOOP
lcl_sql:= rec.insert_script;
EXECUTE IMMEDIATE lcl_sql ;
END LOOP;
COMMIT;
END;
My oracle version Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production