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 > insert stmt in BEFORE UPDATE trigger, supported? SQLSTATE: 42987

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-26-06, 15:54
craigmc craigmc is offline
Registered User
 
Join Date: Aug 2003
Location: austin,tx
Posts: 90
insert stmt in BEFORE UPDATE trigger, supported? SQLSTATE: 42987

I'm trying to trace through a sequence of triggers to see what is happening and thought I would insert into a table when each trigger fired so I could capture the sequence of events. I am getting an error when I try to add an insert stmt to a particular trigger though. It works in an AFTER trigger, but not in a BEFORE trigger. I get a SQLSTATE: 42987 The trigger "<triggername>" is defined with an unsupported triggered SQL statement.

Can you not perform an insert into an unrelated table in a BEFORE UPDATE trigger, or is there maybe something else going on?

This is on Windows machine running DB2 PE 8.1 fp 9.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 06-28-06, 10:50
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
you cannot modify data with an BEFORE trigger.
That means: no INSERT, UPDATE, or DELETE-statement, not even a call to a stored procedure that modifies SQL data.
Reply With Quote
  #3 (permalink)  
Old 06-28-06, 16:51
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
Note that the although the insert happens after the triggering action, it is performed in the same unit of work.
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