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 » regd validation

Post new topic  Reply to topic
 regd validation « View previous topic :: View next topic » 
Author Message
Valarouthu Ravikumar
PostPosted: Tue Feb 19, 2008 6:34 am    Post subject: regd validation Reply with quote

Newbie

Joined: 28 Jan 2008
Posts: 9

i have a String of 3 characters to be validated of whether containing all digits or not.In case of not all numbers an user generated exception needs to be thrown.

We tried like casting the String to integer.It throws exception in case it is not a number.But i need to handle that exception and throw as user defined exception.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Feb 19, 2008 6:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac04850_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak20700_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
akir
PostPosted: Wed Feb 20, 2008 10:21 am    Post subject: Check String which contains numbers or not ?? Reply with quote

Acolyte

Joined: 28 Jun 2007
Posts: 51

Ravi and i have similar issue.

I get a string as input which must contain only numbers else I should throw an user exception.
Ex :'123' is valid
'a12' is invalid

as per Jeff I cannot use trycatch, and also declare handler as STATE is not SQLSTATE in my case.

can any one help me
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jefflowrey
PostPosted: Wed Feb 20, 2008 10:30 am    Post subject: Re: Check String which contains numbers or not ?? Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

akir wrote:
declare handler as STATE is not SQLSTATE in my case.


You can declare a handler for most any ESQL exception.

I'm also not sure why you can't use Try/Catch node for this - but it's been a while since I've played with using it for this kind of thing.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Feb 20, 2008 12:25 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Is this the only field which you are validating? If not, you should consider enabling message validation, In v6.1 XMLNSC validation has minimal impact on performance. In v6 you'll need to use the MRM parser.
Back to top
View user's profile Send private message
akir
PostPosted: Wed Feb 20, 2008 2:50 pm    Post subject: Re: Check String which contains numbers or not ?? Reply with quote

Acolyte

Joined: 28 Jun 2007
Posts: 51

jefflowrey wrote:
akir wrote:
declare handler as STATE is not SQLSTATE in my case.


Quote:
You can declare a handler for most any ESQL exception.
Can you please give me a sample on that so that I can try.

Quote:
I'm also not sure why you can't use Try/Catch node for this - but it's been a while since I've played with using it for this kind of thing.

Its client's requirement that I follow that specification only and handle it with esql only.

For now I have tried and implemented it the hard way like this
CREATE FUNCTION Func_IsNumber(julianDay CHARACTER) RETURNS BOOLEAN
BEGIN
DECLARE listOfDigits CHARACTER ' ,0,1,2,3,4,5,6,7,8,9,';
DECLARE counterValue INTEGER 1;
DECLARE FLAG BOOLEAN TRUE;

--Count is taken till 3 since we get 3 Charcaters only.
WHILE (counterValue <=3) DO
IF (POSITION((SUBSTRING(InputRoot.XML.Message.Value FROM counterValue FOR 1) || ',') IN listOfDigits) = 0) THEN
SET FLAG=(FLAG AND FALSE);
ELSE
SET FLAG=(FLAG AND TRUE);
END IF;
SET counterValue=counterValue+1;
END WHILE;
RETURN FLAG;
END;
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
akir
PostPosted: Wed Feb 20, 2008 2:52 pm    Post subject: Reply with quote

Acolyte

Joined: 28 Jun 2007
Posts: 51

kimbert wrote:
Is this the only field which you are validating? If not, you should consider enabling message validation, In v6.1 XMLNSC validation has minimal impact on performance. In v6 you'll need to use the MRM parser.


Iam using MB6.0 and Iam using MRM parser.Iam also validating another field which is also a repeating structure in Input.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jefflowrey
PostPosted: Wed Feb 20, 2008 3:20 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

MRM should be validating your field(s) for you.
_________________
I am *not* the model of the modern major general.
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 » regd validation
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.