select count(*)
into Vtabcount
from IES_TABLESERIALNUMBER
where TABNAME = PtabName;当我传参的时候 跟踪 Vtabcount为0
但是我在plsql里面执行的时候 select count(*)
from IES_TABLESERIALNUMBER
where TABNAME = PtabName; count(*)是1 求解
into Vtabcount
from IES_TABLESERIALNUMBER
where TABNAME = PtabName;当我传参的时候 跟踪 Vtabcount为0
但是我在plsql里面执行的时候 select count(*)
from IES_TABLESERIALNUMBER
where TABNAME = PtabName; count(*)是1 求解
到底有没有符合这个条件的数据啊?
select count(*)
into Vtabcount
from IES_TABLESERIALNUMBER
where TABNAME = PtabName;
dbms_output.putline(Vtabcount);
跟踪下试下
as
cnt number;
begin
select count(*) into cnt from emp where ename=v_ename;
dbms_output.put_line(cnt);
end;scott@YPCOST> exec pro_test('scott');
0PL/SQL procedure successfully completed.scott@YPCOST> exec pro_test('SCOTT');
1PL/SQL procedure successfully completed.
加个exception捕捉下是否有异常抛出
如果不止一处对一个表修改,要注意运行时的数据,和用sql查出来的可能不一致。