  * this kind of triggers.
  */
 CREATE OR REPLACE TRIGGER CHECK_CONF_LOGGER_EFFECTIVE
-  BEFORE INSERT ON CONF_LOGGERS
+  BEFORE UPDATE OR INSERT ON CONF_LOGGERS
   REFERENCING NEW AS N
   FOR EACH ROW
- T_CHK_CONG_LOGGER: BEGIN ATOMIC
-  DECLARE EXISTING_ID SMALLINT;
+ T_CHK_CONG_LOGGER: BEGIN
+  DECLARE EXISTING_ID ANCHOR CONF_LOGGERS.LOGGER_ID;
   -- Retrieves the current ID from the effective table.
   -- Select Into is not allowed here, and I do not know why.
   SET EXISTING_ID = (SELECT LOGGER_ID

    -- Raises an error.
    SIGNAL SQLSTATE VALUE 'LG002'
      SET MESSAGE_TEXT = 'The only logger without parent is ROOT';
   ELSE
    -- Searches the parent ID.
    SET EXISTING_ID = (SELECT LOGGER_ID
      FROM CONF_LOGGERS E
      WHERE E.LOGGER_ID = N.PARENT_ID);
    -- Checks if the parent id is null.
    IF (EXISTING_ID IS NULL) THEN
    SIGNAL SQLSTATE VALUE 'LG003'
      SET MESSAGE_TEXT = 'The given parent does not exist';
    END IF; 
   END IF;
  END IF;
 END T_CHK_CONG_LOGGER @

  FOR EACH ROW
 WHEN (O.LOGGER_ID = 0)
  T_UNDELETABLE: BEGIN
   SIGNAL SQLSTATE VALUE 'LG003'
     SET MESSAGE_TEXT = 'ROOT logger cannot be deleted';
  END T_UNDELETABLE