Create table 存放错误信息
create table BI_ERROR_RECORD ( error_id NUMBER(16) not null, error_code NUMBER(10), error_msg VARCHAR2(2000 BYTE), error_date DATE, error_program VARCHAR2(200 BYTE) ); create sequence SEQ_BI_ERROR_RECORD minvalue 1 maxvalue 9999999999999999 start with 1 increment by 1 cache 20;
存储过程
CREATE OR REPLACE PROCEDURE SAVE_ERROR_INFO(IN_SQLCODE BI_ERROR_RECORD.ERROR_CODE%TYPE, IN_MSG BI_ERROR_RECORD.ERROR_MSG%TYPE, IN_PROGRAM BI_ERROR_RECORD.ERROR_PROGRAM%TYPE) AS BEGIN
–保存错误信息
INSERT INTO BI_ERROR_RECORD (ERROR_ID, ERROR_CODE, ERROR_MSG, ERROR_DATE, ERROR_PROGRAM) VALUES (SEQ_BI_ERROR_RECORD.NEXTVAL, IN_SQLCODE, IN_MSG, SYSDATE, IN_PROGRAM); END SAVE_ERROR_INFO;