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 can I retrieve an SQL-statement which ended in error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-25-09, 05:37
mar01 mar01 is offline
Registered User
 
Join Date: Feb 2009
Posts: 2
How can I retrieve an SQL-statement which ended in error

I have defined an exit handler in a stored procedure and now I want to store the SQL-statement in error in a table. How can I retrieve the SQL-statement which ended in error
Reply With Quote
  #2 (permalink)  
Old 02-25-09, 05:38
mar01 mar01 is offline
Registered User
 
Join Date: Feb 2009
Posts: 2
Retrieve SQL-statement which ended in error
Reply With Quote
  #3 (permalink)  
Old 02-25-09, 09:03
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
The easiest way I can think of is before you execute a SQL statement, store it in a variable. Then in the error handler, the contents of that variable will be the offending statement to do with what you want.

Andy
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