1
以下過程執行得很好,但其中的'dbms'不打印任何輸出(過程旨在記下其薪水尚未確定的emp的名稱在表中上輸入) 所述表有兩列,即1)name_of_emp 2)薪水(缺省0)dbms_output.put_line即使在'set serveroutput on'後也不打印內部過程
create or replace procedure add_sal_info
as
cursor c is select * from emp_earnings;
cname varchar2(30);
csal number(5);
begin
open c;
while(c%found) loop
fetch c into cname, csal;
if (csal = 0) then
dbms_output.put_line('enter salary for : ' ||' '|| cname);
end if;
end loop;
close c;
end;
/
的SERVEROUTPUT被設置爲「上」和我得到消息「過程已成功完成」執行,但它不打印沒有輸入工資的emp的名字(表中有一些名字)。 這裏有什麼癥結?
是的,明白了,那就做到了!謝謝 –
很高興幫助。 (剛編輯添加一個簡化版本。) –
謝謝,這個更簡單。 –