CREATE OR REPLACE PROCEDURE cp_sys_exception
(
i_vprocname VARCHAR2, --存储过程名称
i_exceptioncontent VARCHAR2, --错误描述
i_ierrornum INT --错误位置
)
AS
PRAGMA AUTONOMOUS_TRANSACTION;
t_ierrorcode INT;
BEGIN
t_ierrorcode := 0;
BEGIN
INSERT INTO sys_exception
(exceptionid,username,exceptiontime,exceptioncontent,errornum)
VALUES
(sys_guid(),i_vprocname,SYSDATE,i_exceptioncontent,DECODE(i_ierrornum,NULL,0, i_ierrornum));
EXCEPTION
WHEN OTHERS THEN
t_ierrorcode := SQLCODE;
END;
IF t_ierrorcode <> 0 THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
RETURN;
END;
/*-- Create table
create table SYS_EXCEPTION
(
EXCEPTIONID CHAR(32) not null,%
阅读(1111) | 评论(0) | 转发(0) |