ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SQLCODE - cathing database error

Post new topic  Reply to topic
 SQLCODE - cathing database error « View previous topic :: View next topic » 
Author Message
neo_revolution
PostPosted: Tue Feb 24, 2004 8:18 pm    Post subject: SQLCODE - cathing database error Reply with quote

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
View user's profile Send private message Yahoo Messenger
fazz
PostPosted: Wed Feb 25, 2004 1:16 am    Post subject: Reply with quote

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
View user's profile Send private message
kspranava
PostPosted: Wed Feb 25, 2004 1:29 am    Post subject: This can also be done Reply with quote

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
View user's profile Send private message
neo_revolution
PostPosted: Wed Feb 25, 2004 5:36 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
JT
PostPosted: Wed Feb 25, 2004 6:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SQLCODE - cathing database error
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.