Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: db2 delete trigger

    Can anyone tell me how can I define a trigger in db2 that copies some rows from a table to another one, when those rows are deleted from the first one?

    I haven't studdied much this problem, but I tried in different ways and then I read that a before trigger can't perform an insert operation.

    Thanx!

    Ruxij

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: db2 delete trigger

    I have two tables tdeltrig and tdeltrig1 with columns i and j (both integers)

    CREATE TRIGGER ADELTRIG
    AFTER DELETE ON TDELTRIG
    REFERENCING OLD AS O
    FOR EACH ROW MODE DB2SQL
    INSERT INTO TDELTRIG_1(I,J) VALUES(O.I,O.J)

    See if this works

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Mar 2004
    Posts
    2

    tnx!

    10x! It worked ok!
    RuxiJ

Posting Permissions

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