Execute immediate for an insert statement
SQL> SQL> -- Define procedure and execute them SQL> SQL> create table mytable ( x int ); Table created. SQL> SQL> create or replace procedure myProcecdure1 as 2 begin 3 for i in 1 .. 10000 4 loop 5 execute immediate 'insert into mytable values ( :x )' using i; 6 end loop; 7 end; 8 / Procedure created. SQL> SQL> create or replace procedure myProcecdure2 as 2 begin 3 for i in 1 .. 10000 4 loop 5 execute immediate 'insert into mytable values ( '||i||')'; 6 end loop; 7 end; 8 / Procedure created. SQL> SQL> exec myProcecdure1; PL/SQL procedure successfully completed. SQL> SQL> exec myProcecdure2; PL/SQL procedure successfully completed. SQL> SQL> SQL> drop table myTable; Table dropped. SQL>