Subject Re: Easy way to find out, if there is a numeric value in a string
Author Myles Wakeham
Olaf wrote:

> I have a stored procedure with an input parameter (varchar). A valid
> value
> can be 'LF200'. I check the first two characters of the string. 'LF' is
> valid. All other input values must be numerically. Is there a
> function, how
> I can see, if there only a numeric value in the string? The other
> way with
> 'LF' have I realised. If there other characters than 'LF' and not a
> valid
> numeric value, then the input parameter is not valid.

Can you cast the substring part of the input parameter into a numeric
variable and see if what you get from the cast, when cast back to a
string matches the substring part of the input parameter? If it
matches, its numeric. If not, it isn't.

Myles

--
=======================
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
Scottsdale, Arizona USA
http://www.techsolusa.com
Phone +1-480-451-7440