|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SQLCODE - cathing database error |
« View previous topic :: View next topic » |
Author |
Message
|
neo_revolution |
Posted: Tue Feb 24, 2004 8:18 pm Post subject: SQLCODE - cathing database error |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
Hi,
I need to handle Database errors.
I am using something like this
IF (SQLCODE<>0 AND SQLCODE<>100) THEN
THROW USER EXCEPTION ....... ;
END IF;
how can I handle errors if database is not available or if my query returns zero records....
If I am using compute node can I pass control to failure node by throwing exception?
Thanks in advance. |
|
Back to top |
|
 |
fazz |
Posted: Wed Feb 25, 2004 1:16 am Post subject: |
|
|
 Centurion
Joined: 20 Feb 2004 Posts: 144 Location: England
|
You could try this:
Wire your comute node to the try terminal of a 'TryCatch' node.
In the compute node, under the advanced tab, check 'Treat warnings as errors' and 'Throw exception on database error'.
Now when you attempt to perform a database operation an exception will be thrown and the message will be passed back downstream to the catch terminal of the the 'TryCatch' node, with the ExceptionList.
Now you could wire a Trace node to the catch terminal and copy the exception out to a file/error log by typing ${ExceptionList} in the pattern box.
Fazz |
|
Back to top |
|
 |
kspranava |
Posted: Wed Feb 25, 2004 1:29 am Post subject: This can also be done |
|
|
 Centurion
Joined: 27 Apr 2003 Posts: 124
|
Hi neo_revolution,
Why dont u try this to redirect the control to a failure terminal, just add a statement "return false;". This works in a filter node but not sure abt it, in a compute node. Let me know if it works...
Pranava |
|
Back to top |
|
 |
neo_revolution |
Posted: Wed Feb 25, 2004 5:36 am Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
Hi All,
I read somewhere in mqseries.net that to use,
IF (SQLCODE<>0 AND SQLCODE<>100) THEN
THROW USER EXCEPTION ....... ;
END IF;
we need to uncheck 'Throw Exception on Database errors' under the advanced tab of compute node. I will try and let know.
Thanks for replies. |
|
Back to top |
|
 |
JT |
Posted: Wed Feb 25, 2004 6:11 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
kspranava,
RETURN(FALSE) does not propogate in a compute node (Page 79 ESQL Reference) |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|