isnumeric
245466Mar 26 2002 — edited Aug 21 2007Is there a function in ORACLE like the isnumeric in SQL Server?
This is what I would like to do: I have a table tbl that has one column col varchar2(5) I would like to append 0 to the begining of the column if the field is numeric.
In SQL Server, This is how I will do it
SELECT * FROM TBL
COL
-----
1
11
1123
ABC
ZZ
18AB
SELECT CASE ISNUMERIC(COL)
WHEN 1 THEN RIGHT('00000'+LTRIM(RTRIM(COL)),5)
ELSE COL
END AS COL
FROM TBL
COL
-----
00001
00011
01123
ABC
ZZ
18AB
Thanks