반응형

CREATE OR REPLACE PACKAGE ORHOME.PC_LOG_PROCESSING AS
 PROCEDURE LOG_TRIGGER (LOG_ERROR VARCHAR2);
END PC_LOG_PROCESSING;

CREATE OR REPLACE PACKAGE BODY ORHOME.PC_LOG_PROCESSING AS -- BODY
 PROCEDURE LOG_TRIGGER (LOG_ERROR VARCHAR2) IS
  FILE_HANDLE UTL_FILE.FILE_TYPE;
  BEGIN
   FILE_HANDLE := UTL_FILE.FOPEN('/log','procedure_log','a');
   UTL_FILE.PUT_LINE(FILE_HANDLE,LOG_ERROR);
   UTL_FILE.FCLOSE(FILE_HANDLE);
  EXCEPTION
   WHEN UTL_FILE.INVALID_MODE THEN
   NULL;
   RAISE_APPLICATION_ERROR(-20322,'file invalid mode');
  WHEN UTL_FILE.INVALID_FILEHANDLE THEN
   NULL;
   RAISE_APPLICATION_ERROR(-20322,'file invalid filehandle');
   WHEN OTHERS THEN
   NULL;
 END LOG_TRIGGER;
END PC_LOG_PROCESSING;

반응형

+ Recent posts