Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

isnumeric

245466Mar 26 2002 — edited Aug 21 2007
Is 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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2007
Added on Mar 26 2002
11 comments
1,720 views