SQL> CREATE or replace PROCEDURE yangbc.Test3
2 AS
3 num varchar2(100);
4 begin
5 execute immediate 'select count(*) from temp' into num;
6 dbms_output.put_line('num='||num);
7 end;
8 /
过程已创建。
SQL> execute test3;
num=7
PL/SQL 过程已成功完成。
SQL>