      SET MESSAGE_TEXT = 'It is not possible to update the LEVEL_ID manually';
   ELSEIF (N.LOGGER_ID IS NULL) THEN
    SIGNAL SQLSTATE VALUE 'PAILA'
-     SET MESSAGE_TEXT = 'LOGGER_ID IS NULL';
+     SET MESSAGE_TEXT = 'LOGGER_ID IS NULL - TODO';
   END IF;
  END T_UPDATE_DELETE @
 

 */
CREATE OR REPLACE TRIGGER T3_CONF_LOGGER_SYNC
  AFTER INSERT OR UPDATE OR DELETE ON LOGDATA.CONF_LOGGERS
  REFERENCING OLD AS O
  FOR EACH ROW
 T_SYNC_CONF: BEGIN

  -- Debug
  -- INSERT INTO LOGS (LEVEL_ID, LOGGER_ID, MESSAGE) VALUES (5, -1, 'tFLAG 4');

  -- It updates the same logger in the configuration, but with the trigger
  -- the descendancy is updated. The level_id provided is recalculated in the
  -- trigger, so the provided is a dummy.
  UPDATE LOGDATA.CONF_LOGGERS_EFFECTIVE
    SET LEVEL_ID = 0
    WHERE LOGGER_ID = O.LOGGER_ID
    WITH UR;
 END T_SYNC_CONF @

-- Table LOGDATA.CONF_LOGGERS_EFFECTIVE.

   -- INSERT INTO LOGS (LEVEL_ID, LOGGER_ID, MESSAGE) VALUES (5, -1, 'tFLAG 8 - ' || coalesce (N.LOGGER_ID, -1));

   -- Gets the value from an ascendency or default.
   -- SET N.LEVEL_ID = LOGADMIN.GET_DEFINED_PARENT_LOGGER(N.LOGGER_ID);
   CALL LOGADMIN.GET_DEFINED_PARENT_LOGGER(N.LOGGER_ID, N.LEVEL_ID);
  ELSE
   -- Gets the value from the configuration. 
   SET N.LEVEL_ID = LEVEL;
