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.