zoukankan      html  css  js  c++  java
  • pl/sql 实例精解 08

       1:  EXCEPTION
       2:    WHEN EXCEPTION_NAME THEN
       3:      ERROR-PROCESSING STATEMENTS;

    写在 begin 与 end 的之间的处理异常块.

    常见异常: 20个.

    多个异常

       1:  declare
       2:      v_student_id        NUMBER := &sv_student_id;
       3:      v_enrolled            VARCHAR2(3) := 'NO';
       4:  begin
       5:      DBMS_OUTPUT.PUT_LINE('Check if the student is enrolled');
       6:      SELECT 'yes'
       7:        INTO v_enrolled
       8:        from enrollment
       9:       where student_id = v_student_id;
      10:      
      11:      dbms_output.put_line('The student is enrolled into one course');
      12:  EXCEPTION
      13:      when no_data_found then
      14:          dbms_output.put_line('The student is not enrolled');
      15:      when too_many_rows then
      16:          dbms_output.put_line('The student is enrolled in too many courses');
      17:  end;
      18:  /
      19:  show errors;
  • 相关阅读:
    用XPath定位Web页面元素时,如何快速验证XPath语句是否正确?
    遇到Web页面禁用鼠标右键操作时,该如何解禁?
    Python之win32模块
    Python之smtplib模块
    Python之telnetlib模块
    使用HttpRunner3+Allure+Jenkins实现Web接口自动化测试
    Python实现Thrift Server
    Python之requests模块-hook
    php新手常用的函数(随时更新)
    手机测试pc端网页
  • 原文地址:https://www.cnblogs.com/moveofgod/p/3653385.html
Copyright © 2011-2022 走看看