A Brief Introduction to Oracle Database PL/SQL Exception Handling Code

Source: Internet
Author: User

We know that any programming language can handle exceptions, such as Java and C ++.Oracle DatabaseHow to handle exceptions? In fact, the handling of Oracle Database exceptions is actually very simple. This article givesPL/SQL Exception HandlingThe Code is as follows:

 
 
  1. declare    
  2.  
  3. e_1 exception;    
  4.  
  5. begin    
  6.  
  7. begin  
  8.  
  9. dbms_output.put_line('0000000');    
  10.  
  11. raise e_1;    
  12.  
  13. exception when e_1 then null;    
  14.  
  15. dbms_output.put_line('aaaaaaaaa');    
  16.  
  17. end;    
  18.  
  19. dbms_output.put_line('bbbbbbbbb');    
  20.  
  21. begin  
  22.  
  23. raise e_1;    
  24.  
  25. exception when e_1 then null;    
  26.  
  27. dbms_output.put_line('ccccccccc');    
  28.  
  29. end;    
  30.  
  31. dbms_output.put_line('ddddddddd');    
  32.  
  33. exception when others then  
  34.  
  35. rollback;  
  36.  
  37. end; 

The above is the Oracle database Pl/SQL Exception Handling Code, hope to have some gains for you, if you want to know

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.