|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Test if a value is numeric |
« View previous topic :: View next topic » |
Author |
Message
|
NikoP |
Posted: Mon Feb 02, 2004 5:25 am Post subject: Test if a value is numeric |
|
|
Novice
Joined: 08 Dec 2003 Posts: 16
|
Hi !
Does anyone know a smart way to test if a value (i.e field content) is numerical or not in ESQL (for WMQI 2.1 + CSD 4).
This value could as well be an integer as a decimal. The goal is to point out any non numerical value in the field.
Thanks in advance ! |
|
Back to top |
|
 |
wooda |
Posted: Mon Feb 02, 2004 8:57 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
You could cast the field to a numeric datatype (eg. INTEGER or DECIMAL)
if the data is not numeric you'll get an exception which you can handle and inspect downstream in your flow.
Alternatively you could use MRM XML and model the field as a numeric datatype, then when the field is parsed you'll also get and exception if the data is not numeric. |
|
Back to top |
|
 |
mgk |
Posted: Mon Feb 02, 2004 9:46 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
There is not built in way to do this in ESQL. The only thing you could do is write a few functions of your own such as validateInteger, validateDecimal, validateFloat etc, and inside each scan the field value character by character, and return some suitable response, such as NULL if the value does not meet the criteria for the type for which you are testing. You could then call these from many places when you need to.
We know this is a pain, and will try to look at it for some future release (no promises tho...)
Cheers, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|