Posted: Thu Jan 06, 2011 8:57 pm Post subject: How to check datatype of a string?
Newbie
Joined: 06 Jan 2011 Posts: 2
I want to check weather a given string is a natural number (i.e. any integer greater then 0) , is there any predefined function provided in ESQL . plz help. [/b]
Posted: Fri Jan 07, 2011 5:14 am Post subject: Re: How to check datatype of a string?
Knight
Joined: 14 Apr 2010 Posts: 522 Location: Craggy Island
himanshubooty wrote:
I want to check weather
Try looking out the window. Is it raining? snowing? is the sun out?
But seriously
himanshubooty wrote:
is there any predefined function provided in ESQL
Don't think so, unless one got added recently. I seem to remember writing my own a while ago. _________________ Never let the facts get in the way of a good theory.
You could use a CAST to INTEGER with a DEFAULT clause and specify -1 as the default. Then you know that if the returned value is < 0 it was not a valid integer... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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