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;
  • 相关阅读:
    YunTable开发日记(16)教程(0.9版RC)
    DevOps,不是一个传说!
    C/C++可变参数函数(转载) zjhfqq的专栏 52RD博客_52RD.com
    c++大写
    fabric install depernedecy
    mysql 在int ,bit类型中都 支持not 取反操作
    关于realloc的原理,与实现方法 C/C++ / C语言
    了解YunTable | 人云亦云
    如何让编译时的出错提示由中文变为英文的? 查看主题 • Ubuntu中文论坛
    Tomcat配置技巧Top 10
  • 原文地址:https://www.cnblogs.com/moveofgod/p/3653385.html
Copyright © 2011-2022 走看看