    -- 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);
+   -- 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;

 */
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.

    -- Raises an error.
    SIGNAL SQLSTATE VALUE 'LG0C1'
      SET MESSAGE_TEXT = 'The only logger without parent is ROOT';
   ELSEIF (INSERTING) THEN
    SELECT LOGGER_ID INTO LOGGER
      FROM LOGDATA.CONF_LOGGERS
      WHERE LOGGER_ID = 0;
    IF (LOGGER IS NOT NULL) THEN
     -- Raises an error.
     SIGNAL SQLSTATE VALUE 'LG0C3'
       SET MESSAGE_TEXT = 'There could be only one ROOT logger';
    END IF;
   END IF;
  END IF;
  -- Prevents to insert a second logger.
