Trigger problem, OS-390/DB2 v7
Hej
Trigger problem.
OS-390/DB2 v7
(GiltigFom and GiltigTom IS NULL)
When the trigger below is executed it is only the first CASE that is SET.
-----------
--------------
Any help would be appreciated.
/uffe
Hej
Trigger problem.
OS-390/DB2 v7
(GiltigFom and GiltigTom IS NULL)
When the trigger below is executed it is only the first CASE that is SET.
-----------
Code:
DROP TRIGGER TR_INSTAANST
CREATE TRIGGER tr_insTAAnst NO CASCADE BEFORE INSERT ON TAAnst
REFERENCING NEW as NEW_VAR
FOR EACH ROW MODE DB2SQL
WHEN (NEW_VAR.A06_GiltigFom IS NULL OR NEW_VAR.A06_GiltigTom IS NULL)
BEGIN ATOMIC
SET NEW_VAR.A06_GiltigFom =
CASE
WHEN NEW_VAR.A06_GiltigFom IS NULL THEN CURRENT DATE
END,
NEW_VAR.A06_GiltigTom =
CASE
WHEN NEW_VAR.A06_GiltigTom IS NULL THEN '2999-12-31'
END;
END
Any help would be appreciated.
/uffe