      END IF;
     END IF;
     FETCH REFERENCES INTO LOGGER_ID_FETCHED, CURRENT_APPENDER_NAME, APPENDER_ID,
-      CONFIGURATION, PATTERN, LVL_REF;
+      CONFIGURATION, PATTERN, LVL_REF, APPEND_NAME;
    END WHILE;
    CLOSE REFERENCES;
   ELSEIF (LOG_ID = -1) THEN

  DECLARE PATTERN ANCHOR LOGDATA.CONF_APPENDERS.PATTERN; -- Appender's pattern.
  DECLARE LVL_REF ANCHOR LOGDATA.CONF_APPENDERS.LEVEL_ID; -- Appender's level.
  DECLARE LOGGER_ID_FETCHED ANCHOR LOGDATA.REFERENCES.LOGGER_ID; -- Logger id to be analyzed.
  DECLARE AT_END BOOLEAN; -- End of the cursor.
  DECLARE ACTIVE BOOLEAN;
  DECLARE NESTING_LEVEL INTEGER;
  DECLARE REFERENCES CURSOR WITH HOLD FOR
    SELECT LOGGER_ID, NAME, APPENDER_ID, CONFIGURATION, PATTERN, LEVEL_ID
    FROM LOGDATA.REFERENCES R JOIN LOGDATA.CONF_APPENDERS C
    ON R.APPENDER_REF_ID = C.REF_ID
    -- 5 active appenders is already too much.
    OPTIMIZE FOR 5 ROW
    WITH UR;

   OPEN REFERENCES;
   SET AT_END = FALSE;
   FETCH REFERENCES INTO LOGGER_ID_FETCHED, CURRENT_APPENDER_NAME, APPENDER_ID,
     CONFIGURATION, PATTERN, LVL_REF, APPEND_NAME;

   -- Iterates over the results.
   WHILE (AT_END = FALSE) DO
