can someone help out ? is it possible to declare variables in a trigger in DB2?
i'm getting an error on following code
thanks

CREATE OR REPLACE TRIGGER TEST.TEST_ID_TRIGGER
BEFORE INSERT ON TEST.CHRY_TEST_CASES FOR EACH ROW
BEGIN ATOMIC
DECLARE
v_var1 VARCHAR(5);
v_var2 VARCHAR(5);
SET v_var1 = SELECT TEST_DOMAIN FROM TEST.CHRYSALIDE_TEST_CASES;
v_var2 = SELECT TEST_DOMAIN FROM TEST.CHRY_TEST_CASES;
set test_id = v_var1||'_'||v_var2||'_'||select lpad(max(substr(test_id,11,3))+1,3,0) from
test.chry_test_cases where TEST_DOMAIN = v_var1 and TABLE_NAME = v_var2
END;