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!

Remove numeric value from a string

skapexSep 29 2012 — edited Sep 29 2012
Oracle 10g.

I want to remove number from beginning of a string
eg,
1ABCD-remove 1 from string and keep ABCD
2PQRS35-remove only 2 from string (ie at beginning of string) and keep PQRS35.

I tried below code but it doesnot work for 2nd example above

select (CASE WHEN instr(:a,regexp_replace(:a,'\D'))=1 THEN substr(:a,2)
ELSE :a
END) result
from dual

Any suggestion would be of great help!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2012
Added on Sep 29 2012
2 comments
1,089 views