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 » Checking for numeric values

Post new topic  Reply to topic
 Checking for numeric values « View previous topic :: View next topic » 
Author Message
saturn_cemk
PostPosted: Mon Apr 23, 2007 6:02 pm    Post subject: Checking for numeric values Reply with quote

Novice

Joined: 10 Jul 2006
Posts: 16

Hi,

I am trying to check whether a field (defined as character) in the input message has numeric value or not. There is no predefined function in ESQL to check this as far as I know. Can anyone suggest a good way for checking this ?

Thanks
Back to top
View user's profile Send private message
sourdas2
PostPosted: Mon Apr 23, 2007 8:24 pm    Post subject: Reply with quote

Voyager

Joined: 21 Apr 2006
Posts: 90
Location: Kolkata,India

MB 6 does not have such kinds of predefined function.

Though you can write an user defined function by calculating the length of the string and checking each character of string with each 0,1,2...9 and '.' (point). If checking is true, then it is a valid number.
_________________
Thanks and Warm Regards
Sourav
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jefflowrey
PostPosted: Mon Apr 23, 2007 9:30 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can cast it as a Number.

Then you can use SQLSTATE to check for ESQL exceptions.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
saturn_cemk
PostPosted: Tue Apr 24, 2007 10:35 am    Post subject: Reply with quote

Novice

Joined: 10 Jul 2006
Posts: 16

Thank you Sourav and Jeff for your suggestions.

I tried both the solutions and both of them worked. Personally, I feel that the second approach is a better way of handling the case.

Thanks again.
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 » Checking for numeric values
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.