异常日志qxp.sql 588 B

12345678910111213141516
  1. DROP TABLE IF EXISTS PROCEDURE_EXCEPTION_LOG;
  2. CREATE TABLE PROCEDURE_EXCEPTION_LOG
  3. (
  4. S_TIME timestamp not null comment '操作时间',
  5. S_code varchar2(255) comment '错误代码',
  6. S_PROCNAME VARCHAR2(64) comment '执行存储过程名称',
  7. S_MSG string comment '错误信息'
  8. )
  9. CLUSTERED BY (S_TIME) INTO 2 BUCKETS
  10. STORED AS ORC TBLPROPERTIES ("transactional"="true");
  11. CREATE OR REPLACE PROCEDURE log_exception(p_procname string,p_msg String,p_code string ) -- 创建存储过程
  12. IS
  13. BEGIN
  14. insert into PROCEDURE_EXCEPTION_LOG VALUES (SYSDATE,p_code,p_procname,p_msg)
  15. END;