If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how to access rowid of a tupe in insert_trigger?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-10, 05:07
duggirala_v duggirala_v is offline
Registered User
 
Join Date: Jan 2010
Posts: 2
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.
Reply With Quote
  #2 (permalink)  
Old 01-27-10, 15:39
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On