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 > TRIGGER and SQLCODE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-17-04, 05:59
Dave Rush Dave Rush is offline
Registered User
 
Join Date: Jun 2004
Posts: 15
TRIGGER and SQLCODE

Hi All,

a simple question with triggers, how can I verify the SQLCODE in a trigger when issuing a simple select statement for example. I want to do something that looks like this:


set v_ex = (select v from t where bla=3)
if (sqlcode = 0 or sqlcode =100)
then SIGNAL SQLSTATE 'this is an example'

Thanks
Reply With Quote
  #2 (permalink)  
Old 09-01-04, 16:30
dmmac dmmac is offline
Registered User
 
Join Date: Aug 2003
Location: Massachusetts, USA
Posts: 106
if not exists (select 1 from t where bla=3) then
SIGNAL SQLSTATE 'this is an example'
end if
Reply With Quote
  #3 (permalink)  
Old 09-02-04, 11:03
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
What is the purpose of this trigger?
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