日期:2014-05-17  浏览次数:20906 次

如何在存储过程中把 select count(*) from tb1的返回值赋给变量,在线等
RT

------解决方案--------------------
SELECT COUNT(*) INTO V_CNT FROM TB1;
------解决方案--------------------
declare
i int;
j int;
s varchar2(100);
begin
s:= 'select count(*),count(*) from t1 ';
execute immediate s into i,j;
dbms_output.put_line( i );
dbms_output.put_line( j );
end;

//输出结果
1
1