Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: Can we create trigger like this in DB2

    Hi all,

    Is it possible to create trigger AFTER INSERT OR UPDATE
    in DB2

    Code:
    CREATE TRIGGER DB2ADMIN.CLIENT_TOTALS
    AFTER INSERT OR UPDATE 
    ON TRANSACTION
    REFERENCING NEW AS N OLD AS O
    FOR EACH ROW
    MODE DB2SQL
    If not then is there a way around


    Thanks

    DBFinder

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by DBFinder
    Is it possible to create trigger AFTER INSERT OR UPDATE
    No.
    Quote Originally Posted by DBFinder
    If not then is there a way around
    Create two triggers - on on insert, another on update.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Thanks,

    Will do that.

    Your clue was important to confirm myself

    Thanks again
    DBFinder

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Have a look at the syntax diagrams in the manual. If you can not map your syntax to the diagrams, then your syntax is not permissible.
    Last edited by stolze; 02-18-09 at 20:13.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Thanks Stolze,

    One senior had clued me the code that seemed odd to me.
    My best trust is dbforums where yourself , n_i , ARWinner are few to mention.

    Thanks again
    DBFinder

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by DBFinder

    One senior had clued me the code that seemed odd to me.
    Let me guess - that person has Oracle background, not DB2.
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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