Validating Numeric and Non-Numeric Values
June 2, 2008 · Print This Article
To check if numeric and non-numeric values, the following syntax can be use.
Syntax
CODE:
-
select DECODE( TRANSLATE(<value here>,'0123456789',' '), NULL, 'Numeric','Character')
-
from dual;
Example
CODE:
-
select DECODE( TRANSLATE('12345Z','0123456789',' '), NULL, 'Numeric','Character')
-
from dual;
The example above will return 'Character' because the value has non-numeric characters.





Comments
Got something to say?