      XMLQUERY('$c/log4db2/appender/configuration/filename' PASSING CONFIGURATION AS "c")
      AS VARCHAR(128));
    -- Remove any carriage return and whitespace around the value.
-   SET DIRECTORY = TRIM(REPLACE(REPLACE(DIRECTORY, CHAR(10), ''), CHAR(13),
+   SET DIRECTORY = TRIM(REPLACE(REPLACE(DIRECTORY, CHR(10), ''), CHR(13),
      ''));
-   SET FILENAME = TRIM(REPLACE(REPLACE(FILENAME, CHAR(10), ''), CHAR(13), ''));
+   SET FILENAME = TRIM(REPLACE(REPLACE(FILENAME, CHR(10), ''), CHR(13), ''));
 
    -- Internal logging.
    --IF (GET_VALUE(LOG_INTERNALS) = VAL_TRUE) THEN

 * Made in COLOMBIA.
 */

SET PATH = SYSPROC, SYSIBMADM, LOGGER_1B @

/**
 * Handle for DB2Logger.

  DECLARE IS_OPEN BOOLEAN;
  DECLARE DIRECTORY VARCHAR(1024);
  DECLARE FILENAME VARCHAR(255);
  DECLARE EXIT HANDLER FOR SQLSTATE '58024'
    INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE)
    VALUES (2, 'Error accesing file: ' || COALESCE(FILENAME, 'NULL') || ' at '
    || COALESCE(DIRECTORY, 'NULL') || ' Open: ' || BOOL_TO_CHAR(IS_OPEN));

  SET IS_OPEN = UTL_FILE.IS_OPEN(UTL_FILE_HANDLER);
  IF ( IS_OPEN != TRUE ) THEN
