Subject | Easy way to find out, if there is a numeric value in a string |
---|---|
Author | Olaf Kluge |
Post date | 2009-05-25T14:03:17Z |
Hello,
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.
Examples:
LF200 is right
LF 9999 is right
87987 is right
XY888 is not valid
If first two characters LF -
Statements
Else if a numeric value
Statemens
Else
Bad value
Thanks in advance.
With best regards
Olaf Kluge
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.
Examples:
LF200 is right
LF 9999 is right
87987 is right
XY888 is not valid
If first two characters LF -
Statements
Else if a numeric value
Statemens
Else
Bad value
Thanks in advance.
With best regards
Olaf Kluge