Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Unanswered: After trigger Issue in DB2

    Hi All,

    I am new to DB2. I am trying to create after trigger using the following code

    CREATE TRIGGER TESTER.ADASCOMCAMCALCS1
    AFTER DELETE ON
    TESTER.ASCOMCAMCGROUPS REFERENCING OLD AS old
    FOR EACH ROW mode db2sql
    BEGIN ATOMIC
    DELETE from tester.dcmodellog
    WHERE idval = old.MCGROUPID
    END

    I am getting the following error message:

    42601(-104)[IBM][CLI Driver][DB2] SQL0104N An unexpected token ";" was found following ";". Expected tokens may include: "<TRIGGERED-SQL-STATEMENT>". SQLSTATE=42601
    (0.00 secs)

    You help is very much appreciated.

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    That's a pretty wierd error message since you do not have a semi colon in the ddl, which is required. I think what you are after is that you have to change your delimeter to a character other than ;
    This is probably what you want:
    CREATE TRIGGER TESTER.ADASCOMCAMCALCS1
    AFTER DELETE ON
    TESTER.ASCOMCAMCGROUPS REFERENCING OLD AS old
    FOR EACH ROW mode db2sql
    BEGIN ATOMIC
    DELETE from tester.dcmodellog
    WHERE idval = old.MCGROUPID ;
    END~
    Dave Nance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •