Oracle異常處理內容,隱式遊標

來源:互聯網
上載者:User

標籤:

異常處理

create or replace procedure pr_test3(v_bh in varchar2,v_xx out t_hq_ryxx%rowtype) isbegin  select * into v_xx from t_hq_ryxx where bianh = v_bh;if sql%found then  dbms_output.put_line(‘尋找到資料了‘);else  dbms_output.put_line(‘未尋找到資料‘);end if;exception  when NO_DATA_FOUND then  --dbms_output.put_line(‘未尋找到資料‘);  dbms_output.put_line(‘SQLCODE = ‘ || SQLCODE);--錯誤碼  dbms_output.put_line(‘SQLERRM = ‘ || SQLERRM);--錯誤資訊      when others then  dbms_output.put_line(‘尋找到出錯‘);  end pr_test3;/

隱式遊標

create or replace procedure pr_test4(v_bh in varchar2) isv_xm t_hq_ryxx%rowtype;begin  --v_xm := ‘106‘;  pr_test3(v_bh, v_xm);dbms_output.put_line(‘v_xm = ‘ || v_xm.ruzrq || v_xm.xingm);  end pr_test4;
create or replace procedure pr_test5 isbegin  update t_hq_ryxx set bum = ‘101‘ where bum is null;if SQL%ROWCOUNT > 0 THEN  dbms_output.put_line(‘更新了‘ || SQL%ROWCOUNT || ‘條記錄‘);  else      dbms_output.put_line(‘更新了0條記錄‘);end if;  commit;end pr_test5;/

 

Oracle異常處理內容,隱式遊標

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.