1--1. Via raise popup (used during debugging)2--2by Sqlcode, SQLERRM these two built-in variables to view, for example:3 4 DECLARE5--declaring exceptions6Some_kinds_of_err EXCEPTION; --Exception to indicate an error condition7 8V_errorcode number; --Variable to hold the error message code9V_errortext VARCHAR2 (200); --Variable to hold the error message textTen One BEGIN A--... ---Throw Exception -IF (...) Then--(The conditions for throwing exceptions are filled in parentheses) the RAISE Some_kinds_of_err; - END IF; ---... - EXCEPTION +--Catching exceptions - When Some_kinds_of_err then + /*Do something to Handler the errors*/ A NULL; at--catch other exceptions and get the content that catches the exception - When OTHERS then -V_errorcode: =SQLCODE; -V_errortext: = SUBSTR (SQLERRM, 1, 200); ---Note the use of SUBSTR here. - inDbms_output.put_line (V_errorcode | | ':: ' | |v_errortext); - END; to + - /** the Sqlcode is the error code . * SQLERRM is a SQL error message. Pay attention to use substr to intercept, otherwise the output is very difficult to see. $ Panax Notoginseng **/
Stored Procedure Print verbose exception