天天看點

動态SQL使用綁定變量

SQL> begin

  for i in 1..1000000 

  loop

    execute immediate 'insert into p1 values(i)' ;

    commit;

  end loop;

end;  2    3    4    5    6    7  

  8  /

begin

*

ERROR at line 1:

ORA-00984: column not allowed here

ORA-06512: at line 4

  for i in 1..1000

    execute immediate 'insert into p1 values(:x)' using i;

end;