課程
/數據庫
/Oracle
/Oracle數據庫開發(fā)必備利器之PL/SQL基礎
用enter輸入提示的代碼,能不能運行
2018-07-09
源自:Oracle數據庫開發(fā)必備利器之PL/SQL基礎 2-1
正在回答
set serveroutput on
declare
? ? cursor c is select name from tb_1 where id=5;
? ? pname tb_1.name%type;
? ? not_found_emp exception;
begin
open c;
fetch c into pname;
if c%notfound then
? ? raise not_found_emp;
end if;
close c;
exception
when not_found_emp then DBMS_OUTPUT.PUT_LINE('沒有找到5號員工');
when others then dbms_output.put_line('其他例外');
end;
/
舉報
Oracle數據庫高級開發(fā)必備的基礎,通過實例帶你熟練掌握
1 回答跟著老師的代碼寫,為什么總是報錯不能輸出?
3 回答我的if語句不起作用,望大家指導下
1 回答光標的退出條件語句的書寫位置
3 回答為什么SALTOTAL要大寫呢?
1 回答軟件問題腳本輸出
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-07-15
set serveroutput on
declare
? ? cursor c is select name from tb_1 where id=5;
? ? pname tb_1.name%type;
? ? not_found_emp exception;
begin
open c;
fetch c into pname;
if c%notfound then
? ? raise not_found_emp;
end if;
close c;
exception
when not_found_emp then DBMS_OUTPUT.PUT_LINE('沒有找到5號員工');
when others then dbms_output.put_line('其他例外');
close c;
end;
/