Trigger Failing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a_rajanikanth
    New Member
    • Apr 2006
    • 1

    Trigger Failing

    Hi,

    The following is the trigger which is failing when executing. Can you please tell me the reason why it is failing ?

    Trigger got created but throwing exception.

    Code:
     CREATE TRIGGER TOBJ_U 
    AFTER UPDATE
    ON TABLE1
    REFERENCING OLD AS OLD NEW AS NEW 
    FOR EACH ROW MODE DB2SQL 
     
    BEGIN ATOMIC
    DECLARE var_impossibledate VARCHAR(12);-- DO NOT REMOVE THIS COMMENT
    SET var_impossibledate ='1800-01-01';-- DO NOT REMOVE THIS COMMENT
    IF (COALESCE(NEW.DATECOL, var_impossibledate) != COALESCE(OLD.DATECOL,var_impossibledate)) THEN
    UPDATE TABLE2 SET Startdate = NEW.DATECOL 
    WHERE
    OBJID1 is null;-- DO NOT REMOVE THIS COMMENT
    END IF;-- DO NOT REMOVE THIS COMMENT--
     
    END
    Thanks in Advance

    Rajani Kanth
    Last edited by Niheel; Apr 13 '06, 10:28 PM.
Working...