Pl/sql Exception Handling

Source: Internet
Author: User
Tags error code exception handling execution sqlplus

When designing a Pl/sql program, this or that error occurs frequently, and exception handling is the segment of the program that handles the error, and the exception handling in Oracle 9i is divided into system predefined exception handling and custom exception handling.

System predefined exception handling

System predefined exception handling is a procedure to deal with the problems that occur during the compilation and execution of Pl/sql programs. The following code is the correct code and can be executed successfully in "Sqlplus Worksheet".

―――――――――――――――――――――――――――――――――――――
set serveroutput on
declare
tempno integer:=90;
begin
tempno:=tempno+1;
end;
―――――――――――――――――――――――――――――――――――――

"Matching program Location": 9th Chapter \ Correctplsql.sql.

The following code is an error code, and the results of the execution in "Sqlplus worksheet" are shown in Figure 9.56.

"Matching program Location": 9th Chapter \ Wrongplsql.sql.

Because of the error in the code, the system's predefined exception handling is activated and the following message is drawn.

Oracle 9i provides a lot of exception handling, and readers can try to modify a program that works correctly and execute a modified program to discover which exception handlers are invoked, and here's how to customize exception handling.

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.