DECLARE
v_empno emp.empno%type;
v_ename emp.ename%type;
v_sal emp.sal%type;
--声明一个游标
cursor c_emp is
select empno,ename,sal
from emp
where ename = 'SCOTT';
BEGIN
--打开游标
open c_emp;
--判断游标是否返回记录, if c_emp%notfound then
dbms_output.put_line('没有找到相应的记录');
else
--从游标中读取记录
fetch c_emp into v_empno,v_ename,v_sal;
dbms_output.put_line(v_empno||' '||v_ename||' '||v_sal);
end if;
close c_emp;
END;
怎么没有找到数据他都不打印出没有找到相应的记录呢?????????