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 » Extract Function Error Handling

Post new topic  Reply to topic
 Extract Function Error Handling « View previous topic :: View next topic » 
Author Message
andrewhirst
PostPosted: Wed Oct 13, 2004 12:07 am    Post subject: Extract Function Error Handling Reply with quote

Apprentice

Joined: 06 Jul 2004
Posts: 33
Location: UK

Hello,

I'm using the EXTRACT function to convert a date_time variable into a string of a particular format. Sometimes, the stored procedure will return "-" indicating that no date exists. In this case EXTRACT will fail as the source is not in the correct format. What is the best way of handling this failure? The ESQL manual doesn't really say much about it....

So far, I'm simply testing for "-" and then handling it another way. Not tested yet...

TIA,

Andrew.
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed Oct 13, 2004 1:07 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

You can either swallow the error by taking corrective action and continuing with the flow (e.g. use a default date), or throw an exception to indicate that the flow cannot continue and intervention is required.
Back to top
View user's profile Send private message Send e-mail
andrewhirst
PostPosted: Wed Oct 13, 2004 5:52 am    Post subject: Reply with quote

Apprentice

Joined: 06 Jul 2004
Posts: 33
Location: UK

This seems to work:

Code:
SET dbyear = EXTRACT(YEAR FROM Environment.Variables.Details."WARRANTY_EXPIRY_DATE");
if dbyear = '' then
   SET dbdate = '0000/00/00';
else
   SET dbmonth = EXTRACT(MONTH FROM Environment.Variables.Details."WARRANTY_EXPIRY_DATE");
   SET dbday = EXTRACT(DAY FROM Environment.Variables.Details."WARRANTY_EXPIRY_DATE");
   SET dbdate = dbday || '/' || dbmonth  || '/' || dbyear;
end if;


Regards,

Andrew.
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 » Extract Function Error Handling
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.