execute immediate

 
-- Created on 2012-01-10 by KANLIANHUI689 
declare 
  -- Local variables here
  i integer;
  v_sql varchar(100);
begin
  -- Test statements here
  v_sql :=null;
  i := 0;
  v_sql := 'begin abc';
  v_sql := v_sql || '(' || i || '); end;';
  abc(1);
  execute immediate v_sql;
   i := 1000;
   v_sql := 'begin abc';
   v_sql := v_sql || '(:i); end;';
   execute immediate v_sql
           using i;
end;

你可能感兴趣的:(Oracle)