Oracle Stored Procedure Error Tracking (saving error row numbers, error codes, error messages) 1. create table 1 create table TBL_PROC_ERRMSG2 (3 BIZ_CODE VARCHAR2 (50), 4 ERR_LINE VARCHAR2 (10), 5 ERR_CODE VARCHAR2 (10 ), 6 MSG VARCHAR2 (200), 7 CRT_TM date default SYSDATE8 www.2cto.com); 2. 01 create or replace procedure PROC_SAVE_ERRMSG (bizcode in VARCHAR2, 02 errorline in VARCHAR2, 03 errorcode in VARCHAR2, 04 msg in VARCHAR2) IS05/* must use autonomous transactions, otherwise commit will affect the calling program transaction */06 PRAGMA AUTONOMOUS_TRANSACTION; 07BEGIN08 insert into partition (BIZ_CODE, ERR_LINE, ERR_CODE, MSG) 10 VALUES11 (BIZCODE, ERRORLINE, ERRORCODE, MSG); 12 www.2cto.com COMMIT; 13END; 3. use Example 1 -- the Stored Procedure implements subject 2EXCEPTION3 when others THEN4 PROC_SAVE_ERRMSG (biz_code/* this variable is used to find error record mark */, DBMS_UTILITY.format_error_backtrace, sqlcode, SQLERRM;