 DECLARE EXPECTED_LEVEL ANCHOR DATA TYPE TO LOGDATA.LEVELS.LEVEL_ID;
 
 -- Controlled SQL State.
-DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG0E1'
+DECLARE CONTINUE HANDLER FOR SQLSTATE 'LGAE1'
   BEGIN
    INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (5, 'SQLState ' || SQLSTATE);
-   SET RAISED_LG0E1 = TRUE;
+   SET RAISED_LGAE1 = TRUE;
+  END;
+DECLARE CONTINUE HANDLER FOR SQLSTATE 'LGBE1'
+  BEGIN
+   INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (5, 'SQLState ' || SQLSTATE);
+   SET RAISED_LGBE1 = TRUE;
   END;
 DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG0E2'
   BEGIN
    INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (5, 'SQLState ' || SQLSTATE);
    SET RAISED_LG0E2 = TRUE;
   END;
-DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG0E3'
+DECLARE CONTINUE HANDLER FOR SQLSTATE 'LGAE3'
   BEGIN
    INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (5, 'SQLState ' || SQLSTATE);
-   SET RAISED_LG0E3 = TRUE;
+   SET RAISED_LGAE3 = TRUE;
+  END;
+DECLARE CONTINUE HANDLER FOR SQLSTATE 'LGBE3'
+  BEGIN
+   INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (5, 'SQLState ' || SQLSTATE);
+   SET RAISED_LGBE3 = TRUE;
   END;
 DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG0E4'
   BEGIN

DECLARE SQLCODE INTEGER DEFAULT 0;
DECLARE SQLSTATE CHAR(5) DEFAULT '00000';

DECLARE RAISED_LG0E1 BOOLEAN DEFAULT FALSE; -- Logger without parent.
DECLARE RAISED_LG0E2 BOOLEAN DEFAULT FALSE; -- Modifying values.
DECLARE RAISED_LG0E3 BOOLEAN DEFAULT FALSE; -- Modifying level_id.
DECLARE RAISED_LG0E4 BOOLEAN DEFAULT FALSE; -- ROOT logger should always exist.
DECLARE RAISED_LG0E5 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
DECLARE RAISED_407 BOOLEAN DEFAULT FALSE; -- Null value.

SET ACTUAL_LEVEL = 3; -- Default level
INSERT INTO LOGDATA.CONF_LOGGERS_EFFECTIVE (LOGGER_ID, NAME, PARENT_ID, LEVEL_ID) VALUES
  (ACTUAL_LOGGER, 'test7', ACTUAL_PARENT, ACTUAL_LEVEL);
IF (RAISED_LGAE1 = FALSE) THEN
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (2, 'Exception not raised');
ELSE
 INSERT INTO LOGDATA.LOGS (LEVEL_ID, MESSAGE) VALUES (5, 'Exception raised LG0E1');
END IF;
SET RAISED_LGAE1 = FALSE;
COMMIT;

-- Test8: Inserts a logger with an null level.
