 
 --Tests
 
--- Test01: Limit logging to ROOT with fatal.
-CREATE OR REPLACE PROCEDURE TEST_01()
- BEGIN
-  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CASCADE SMALLINT; -- Cascade calls.
-  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
-    BEGIN END;
-
-  SET EXPECTED = 'TRUE';
-  SET CASCADE = VAL_57B;
+-- Test01: Limit achieved logging to ROOT with fatal.
+CREATE OR REPLACE PROCEDURE TEST_01A()
+ BEGIN
+  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
+  DECLARE CASCADE SMALLINT; -- Cascade calls.
+  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
+  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT. 
+  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
+    SET RAISED_LG001 = TRUE;
+
+  SET EXPECTED = 'TRUE';
+  SET CASCADE = VAL_A_55_56;
   CALL LOGGING(1, 1, CASCADE);
-  SELECT 'TRUE' INTO ACTUAL
-    FROM LOGS
-    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for FATAL: (0) '
-    || 'Cascade call for "LOGGING" enters with ' || CASCADE
-    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);
-
-  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test01: Limit logging to ROOT with fatal',
-    EXPECTED, ACTUAL);
- END @
-
--- Test02: Limit achieved logging to ROOT with fatal.
-CREATE OR REPLACE PROCEDURE TEST_02()
- BEGIN
-  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CASCADE SMALLINT; -- Cascade calls.
-  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
-  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
-    SET RAISED_LG001 = TRUE;
-
-  SET EXPECTED = 'TRUE';
-  SET CASCADE = VAL_56_57;
-  CALL LOGGING(1, 1, CASCADE);
-
-  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test02: Limit achieved to ROOT with fatal',
+
+  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test01: Limit achieved to ROOT with fatal',
     RAISED_LG001);
 
   SELECT 'TRUE' INTO ACTUAL
     FROM LOGS
     WHERE MESSAGE LIKE 'LG001. Cascade call limit achieved, for LOG: Cascade '
     || 'call for "LOGGING" enters with ' || CASCADE
-    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS)
-    ;
-
-  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test02: Limit achieved to ROOT with fatal',
-    EXPECTED, ACTUAL);
- END @
-
--- Test03: Limit passed logging to ROOT with fatal.
-CREATE OR REPLACE PROCEDURE TEST_03()
- BEGIN
-  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CASCADE SMALLINT; -- Cascade calls.
-  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
-  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
-    SET RAISED_LG001 = TRUE;
-
-  SET EXPECTED = 'TRUE';
-  SET CASCADE = VAL_57A;
-  CALL LOGGING(1, 1, CASCADE);
-
-  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test03: Limit passed to ROOT with fatal',
-    RAISED_LG001);
-
-  SELECT 'TRUE' INTO ACTUAL
-    FROM LOGS
-    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieved, for FATAL: (0) '
-    || 'Cascade call for "LOGGING" en%'
-    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);
-
-  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test03: Limit passed to ROOT with fatal',
-    EXPECTED, ACTUAL);
-  DELETE FROM LOGS
-    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieve, for %';
- END @
-
--- Test04: Cascade call limit with fatal.
-CREATE OR REPLACE PROCEDURE TEST_04()
- BEGIN
-  DECLARE CASCADE SMALLINT; -- Cascade calls.
-  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
-  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
-    SET RAISED_724 = TRUE;
-
-  SET CASCADE = MIN_59;
-  CALL LOGGING(1, 1, CASCADE);
-
-  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test04: Cascade call limit with fatal',
-    RAISED_724);
- END @
-
--- Test05: Limit logging to ROOT with error.
-CREATE OR REPLACE PROCEDURE TEST_05()
- BEGIN
-  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CASCADE SMALLINT; -- Cascade calls.
-  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
-    BEGIN END;
-
-  SET EXPECTED = 'TRUE';
-  SET CASCADE = VAL_57B;
+    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);
+
+  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test01: Limit achieved to ROOT with fatal',
+    EXPECTED, ACTUAL);
+ END @
+
+-- Test02: Limit achieved logging to ROOT with error.
+CREATE OR REPLACE PROCEDURE TEST_02A()
+ BEGIN
+  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
+  DECLARE CASCADE SMALLINT; -- Cascade calls.
+  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
+  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
+  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
+    SET RAISED_LG001 = TRUE;
+
+  SET EXPECTED = 'TRUE';
+  SET CASCADE = VAL_A_55_56;
   CALL LOGGING(1, 2, CASCADE);
-  SELECT 'TRUE' INTO ACTUAL
-    FROM LOGS
-    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for ERROR: (0) '
-    || 'Cascade call for "LOGGING" enters with ' || CASCADE
-    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);
-
-  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test05: Limit logging to ROOT with error',
-    EXPECTED, ACTUAL);
- END @
-
--- Test06: Limit achieved logging to ROOT with error.
-CREATE OR REPLACE PROCEDURE TEST_06()
- BEGIN
-  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE CASCADE SMALLINT; -- Cascade calls.
-  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
-  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
-  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
-    SET RAISED_LG001 = TRUE;
-
-  SET EXPECTED = 'TRUE';
-  SET CASCADE = VAL_56_57;
-  CALL LOGGING(1, 2, CASCADE);
-
-  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test06: Limit achieved to ROOT with error',
+
+  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test02: Limit achieved to ROOT with error',
     RAISED_LG001);
 
   SELECT 'TRUE' INTO ACTUAL

BEGIN
 DECLARE STATEMENT VARCHAR(128);
 DECLARE CONTINUE HANDLER FOR SQLSTATE '42704' BEGIN END;
 SET STATEMENT = 'DROP VARIABLE VAL_56_57';
 EXECUTE IMMEDIATE STATEMENT;
 SET STATEMENT = 'DROP VARIABLE VAL_56_58';
 EXECUTE IMMEDIATE STATEMENT;
 SET STATEMENT = 'DROP VARIABLE VAL_57A';
 EXECUTE IMMEDIATE STATEMENT;
 SET STATEMENT = 'DROP VARIABLE VAL_57B';
 EXECUTE IMMEDIATE STATEMENT;
 SET STATEMENT = 'DROP VARIABLE VAL_57_58';
 EXECUTE IMMEDIATE STATEMENT;
 SET STATEMENT = 'DROP VARIABLE MIN_59';
 EXECUTE IMMEDIATE STATEMENT;
END @

-- 56 or 57 for test 02, 06, 14, 18, 23, 24
CREATE VARIABLE VAL_56_57 SMALLINT CONSTANT 56 @
-- 56-58 for test 10
CREATE VARIABLE VAL_56_58 SMALLINT CONSTANT 56 @
-- 57 for test 03, 07, 11, 15, 19
CREATE VARIABLE VAL_57A SMALLINT CONSTANT 57 @
-- 57 for test 05, 09, 13, 17
CREATE VARIABLE VAL_57B SMALLINT CONSTANT 57 @
-- 57 or 58 for test 21
CREATE VARIABLE VAL_57_58 SMALLINT CONSTANT 57 @
-- 59 ... for test 04, 08, 12, 16, 20, 22
CREATE VARIABLE MIN_59 SMALLINT CONSTANT 59 @

CREATE OR REPLACE PROCEDURE LOGGING (
  IN VAL SMALLINT,

    || 'Cascade call for "LOGGING" en%'
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test10: Limit passed to ROOT with warn',
    EXPECTED, ACTUAL);
--  DELETE FROM LOGS
--    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieve, for %';
 END @

-- Test11: Limit passed logging to ROOT with info.
CREATE OR REPLACE PROCEDURE TEST_11C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    SET RAISED_LG001 = TRUE;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 4, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test11: Limit passed to ROOT with info',
    RAISED_LG001);

  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieved, for INFO: (0) '
    || 'Cascade call for "LOGGING" en%'
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test11: Limit passed to ROOT with info',
    EXPECTED, ACTUAL);
  DELETE FROM LOGS
    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieve, for %';
 END @

-- Test12: Limit passed logging to ROOT with debug.
CREATE OR REPLACE PROCEDURE TEST_12C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    SET RAISED_LG001 = TRUE;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 5, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test12: Limit passed to ROOT with debug',
    RAISED_LG001);

  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieved, for DEBUG: (0) '
    || 'Cascade call for "LOGGING" en%'
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test12: Limit passed to ROOT with debug',
    EXPECTED, ACTUAL);
  DELETE FROM LOGS
    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieve, for %';
 END @

-- Test13: Limit logging to ROOT with fatal.
CREATE OR REPLACE PROCEDURE TEST_13C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    BEGIN END;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 1, CASCADE);
  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for FATAL: (0) '
    || 'Cascade call for "LOGGING" enters with ' || CASCADE
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test13: Limit logging to ROOT with fatal',
    EXPECTED, ACTUAL);
 END @

-- Test14: Limit logging to ROOT with error.
CREATE OR REPLACE PROCEDURE TEST_14C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    BEGIN END;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 2, CASCADE);
  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for ERROR: (0) '
    || 'Cascade call for "LOGGING" enters with ' || CASCADE
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test05: Limit logging to ROOT with error',
    EXPECTED, ACTUAL);
 END @

-- Test15: Limit logging to ROOT with warn.
CREATE OR REPLACE PROCEDURE TEST_15C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    BEGIN END;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 3, CASCADE);
  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for WARN: (0) Cascade '
    || 'call for "LOGGING" enters with ' || CASCADE
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test09: Limit logging to ROOT with warn',
    EXPECTED, ACTUAL);
 END @

-- Test16: Limit logging to ROOT with info.
CREATE OR REPLACE PROCEDURE TEST_16C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    BEGIN END;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 4, CASCADE);
  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for INFO: (0) Cascade '
    || 'call for "LOGGING" enters with ' || CASCADE
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test13: Limit logging to ROOT with info',
    EXPECTED, ACTUAL);
 END @

-- Test17: Limit logging to ROOT with debug.
CREATE OR REPLACE PROCEDURE TEST_17C()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    BEGIN END;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_C_57;
  CALL LOGGING(1, 5, CASCADE);
  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE = 'LG001. Cascade call limit achieved, for DEBUG: (0) '
    || 'Cascade call for "LOGGING" enters with ' || CASCADE
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test17: Limit logging to ROOT with debug',
    EXPECTED, ACTUAL);
 END @

-- Test18: Cascade call limit with fatal.
CREATE OR REPLACE PROCEDURE TEST_18D()
 BEGIN
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
    SET RAISED_724 = TRUE;

  SET CASCADE = MIN_D_58;
  CALL LOGGING(1, 1, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test18: Cascade call limit with fatal',
    RAISED_724);
 END @

-- Test19: Cascade call limit with error.
CREATE OR REPLACE PROCEDURE TEST_19D()
 BEGIN
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
    SET RAISED_724 = TRUE;

  SET CASCADE = MIN_D_58;
  CALL LOGGING(1, 2, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test19: Cascade call limit with error',
    RAISED_724);
 END @

-- Test20: Cascade call limit with warn.
CREATE OR REPLACE PROCEDURE TEST_20D()
 BEGIN
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
    SET RAISED_724 = TRUE;

  SET CASCADE = MIN_D_58;
  CALL LOGGING(1, 3, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test20: Cascade call limit with warn',
    RAISED_724);
 END @

-- Test21: Cascade call limit with info.
CREATE OR REPLACE PROCEDURE TEST_21D()
 BEGIN
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
    SET RAISED_724 = TRUE;

  SET CASCADE = MIN_D_58;
  CALL LOGGING(1, 4, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test21: Cascade call limit with info',
    RAISED_724);
 END @

-- Test22: Cascade call limit with debug.
CREATE OR REPLACE PROCEDURE TEST_22D()
 BEGIN
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
    SET RAISED_724 = TRUE;

  SET CASCADE = MIN_D_58;
  CALL LOGGING(1, 5, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test22: Cascade call limit with debug',
    RAISED_724);
 END @

-- Test24: Cascade call limit with default.
CREATE OR REPLACE PROCEDURE TEST_23D()
 BEGIN
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE RAISED_724 BOOLEAN DEFAULT FALSE; -- Null value.
  DECLARE CONTINUE HANDLER FOR SQLSTATE '54038'
    SET RAISED_724 = TRUE;

  SET CASCADE = MIN_D_58;
  CALL LOGGING(1, -1, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test23: Cascade call limit with default',
    RAISED_724);
 END @

-- Test2F: Limit passed logging to ROOT with default.
CREATE OR REPLACE PROCEDURE TEST_24E()
 BEGIN
  DECLARE EXPECTED ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE CASCADE SMALLINT; -- Cascade calls.
  DECLARE ACTUAL ANCHOR DATA TYPE TO LOGDATA.LOGS.MESSAGE;
  DECLARE RAISED_LG001 BOOLEAN DEFAULT FALSE; -- Just one ROOT.
  DECLARE CONTINUE HANDLER FOR SQLSTATE 'LG001'
    SET RAISED_LG001 = TRUE;

  SET EXPECTED = 'TRUE';
  SET CASCADE = VAL_E_56_57;
  CALL LOGGING(1, -1, CASCADE);

  CALL DB2UNIT.ASSERT_BOOLEAN_TRUE('Test24: Limit passed to ROOT with default',
    RAISED_LG001);

  SELECT 'TRUE' INTO ACTUAL
    FROM LOGS
    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieved, for LOG: Cascade '
    || 'call for "LOGGING" enters w%'
    AND DATE = (SELECT MAX(DATE) FROM LOGDATA.LOGS);

  CALL DB2UNIT.ASSERT_STRING_EQUALS('Test24: Limit passed to ROOT with default',
    EXPECTED, ACTUAL);
  DELETE FROM LOGS
    WHERE MESSAGE LIKE 'LG001. Cascade call limit achieve, for %';
 END @

-- Register the suite.
