[sql]
create or replace package body PKG_LOG is
/*存储过程记录日志*/
/*记录消息*/
PROCEDURE INFO(p_proc_name varchar2, title varchar2, content varchar2) is
begin
INSERT INTO t_proc_logs(xh,proc_mc,title,content, log_type,log_time)
VALUES (SEQ_T_PROC_LOGS_XH.NEXTVAL, upper(p_proc_name), substr(title,1,4000), substr(content,1,4000), ‘INFO‘,sysdate);
COMMIT;
EXCEPTION WHEN OTHERS THEN
NULL;
ROLLBACK;
END;
/*记录测试*/
PROCEDURE DEBUG(p_proc_name varchar2, title varchar2, content varchar2) is
begin
INSERT INTO t_proc_logs(xh,proc_mc,title,content, log_type,log_time)
VALUES (SEQ_T_PROC_LOGS_XH.NEXTVAL, upper(p_proc_name), substr(title,1,4000), substr(content,1,4000), ‘DEBUG‘,sysdate);
COMMIT;
EXCEPTION WHEN OTHERS THEN
NULL;
ROLLBACK;
END;
/*记录错误*/
PROCEDURE ERROR(p_proc_name varchar2, title varchar2, content varchar2) is
begin
INSERT INTO t_proc_logs(xh,proc_mc,title,content, log_type,log_time)
VALUES (SEQ_T_PROC_LOGS_XH.NEXTVAL, upper(p_proc_name), substr(title,1,4000), substr(content,1,4000), ‘ERROR‘,sysdate);
COMMIT;
EXCEPTION WHEN OTHERS THEN
NULL;
ROLLBACK;
END;
end PKG_LOG;