   DECLARE EXISTS SMALLINT DEFAULT 0;
 
   -- Debug
-  -- INSERT INTO LOGS (DATE, LEVEL_ID, LOGGER_ID, MESSAGE) VALUES (GENERATE_UNIQUE(), 5, -1, 'FLAG 1 - ' || coalesce (SON_ID, -1));
+  -- INSERT INTO LOGS (DATE, LEVEL_ID, LOGGER_ID, MESSAGE) VALUES (GENERATE_UNIQUE(), 5, -1, 'aFLAG 1 - ' || coalesce (SON_ID, -1));
 
   IF (SON_ID IS NULL OR SON_ID < 0) THEN
-   SIGNAL SQLSTATE VALUE 'LG001'
+   SIGNAL SQLSTATE VALUE 'LG0F1'
      SET MESSAGE_TEXT = 'Invalid parameter';
   ELSEIF (SON_ID = 0) THEN
    -- Asking for the level for ROOT.

    IF (RET IS NULL) THEN

     -- Debug
     -- INSERT INTO LOGS (DATE, LEVEL_ID, LOGGER_ID, MESSAGE) VALUES (GENERATE_UNIQUE(), 5, -1, 'FLAG 3 - ' || coalesce (PARENT, -1));

     -- The parent has not a configured level, doing a recursion.
     BEGIN

   -- Checks if the level is defined in Conf_loggers
   SELECT 1 INTO EXISTS
     FROM LOGDATA.CONF_LOGGERS
     WHERE LOGGER_ID = SON_ID
     WITH UR;

   -- Debug
   -- INSERT INTO LOGS (DATE, LEVEL_ID, LOGGER_ID, MESSAGE) VALUES (GENERATE_UNIQUE(), 5, -1, 'aFLAG 2 - ' || coalesce (EXISTS, -1));

   IF (EXISTS = 1) THEN
    -- Asking for a value different to ROOT.
