Then write a RPG function that converts the character string into a numeric
value using %DEC.
If the function crashes return 0 else 1.
Register this RPG function as SQL UDF and use it!
Mit freundlichen Grüßen / Best regards
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von John Yeung
Gesendet: Tuesday, 15.1 2013 18:29
An: Midrange Systems Technical Discussion
Betreff: Re: SQL is numeric function
On Tue, Jan 15, 2013 at 11:56 AM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
No, you only can check for numeric values by translating all digits
(and Decimal Point) into *Blanks and checking whether the string is not
This is a nice and simple method for "well behaved" data, but has
limitations. For example, it will also consider '22.214.171.124' and '12
.3 4....' to be numeric values. It also doesn't handle negative
numbers or scientific notation, which may or may not be relevant.
The lack of an IsNumeric function is a common complaint. See this article
for more information:
tl;dr: Create a UDF. You'll probably need it over and over again anyway,
so in the long run you'll be glad you did.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l