Subject | Re: Easy way to find out, if there is a numeric value in a string |
---|---|
Author | Myles Wakeham |
Post date | 2009-05-25T14:21:22Z |
Olaf wrote:
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
> I have a stored procedure with an input parameter (varchar). A validCan you cast the substring part of the input parameter into a numeric
> 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.
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