PLS-483 error: Duplicate Handlers : Exception Handle « PL SQL « Oracle PL / SQL






PLS-483 error: Duplicate Handlers

     
SQL>
SQL> CREATE TABLE myLogTable (
  2    code             NUMBER,
  3    message          VARCHAR2(200),
  4    info             VARCHAR2(100)
  5    );

Table created.

SQL>
SQL>
SQL> DECLARE
  2    e_Exception1 EXCEPTION;
  3    e_Exception2 EXCEPTION;
  4  BEGIN
  5    RAISE e_Exception1;
  6  EXCEPTION
  7    WHEN e_Exception2 THEN
  8      INSERT INTO myLogTable (info)
  9        VALUES ('Handler 1 executed!');
 10    WHEN e_Exception1 THEN
 11      INSERT INTO myLogTable (info)
 12        VALUES ('Handler 3 executed!');
 13    WHEN e_Exception1 OR e_Exception2 THEN
 14      INSERT INTO myLogTable (info)
 15        VALUES ('Handler 4 executed!');
 16  END;
 17  /
  WHEN e_Exception1 OR e_Exception2 THEN
  *
ERROR at line 13:
ORA-06550: line 13, column 3:
PLS-00483: exception 'E_EXCEPTION2' may appear in at most one exception handler in this block
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated


SQL>
SQL> drop table myLogTable;

Table dropped.

SQL>

   
    
    
    
  








Related examples in the same category

1.Check exception type
2.Deal with multiple exception branches
3.when other exceptions then
4.Handle update exception
5.declaration exception
6.handle exception of duplicate value on index
7.when other then not user-defined exception
8.Using PRAGMA EXCEPTION_INIT
9.Different Values of SQLCODE and SQLERRM
10.The OTHERS Exception Handler
11.Error-handling features of PL/SQL: log exception
12.NO_DATA_FOUND exception.
13.The scope of exceptions.
14.Sub block in exception section
15.Catch all exceptions
16.Catch user-defined exception
17.Check zero divide exception
18.Combines declaring an EXCEPTION variable
19.Insert error message to a table in exception handler
20.Mapping a user-defined error code to an EXCEPTION variable
21.This script demonstrates the EXCEPTION_INIT pragma.
22.Error Handling Call
23.Raise exception in if statement