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

    Unanswered: how to access rowid of a tupe in insert_trigger?

    Hello All,

    I need some help in DB2 Triggers.

    I am using DB2 LUW V9.7. Can i access rowid of a inserted tuple in after_insert_trigger?

    For example:
    create table t1(i clob )
    go

    I want to create after_insert_trigger on t1 which gets the rowid of the inserted tuple and calls a function f1 which takes rowid of that tuple.

    Is there a way to access the rowid??

    i want trigger like this

    create trigger t1_insert_trig
    AFTER insert ON t1
    FOR EACH ROW
    begin
    f1(???) <--- i want to pass the row id of the newly inserted tuple.
    end@

    If not insert trigger, can i do access rowid in update trigger?

    Thanks in advance for the help,
    Venkatesh.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Your table doesn't have a row-id because you only defined a single column in it. And you can't access what isn't there.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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