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!

Find the first occurrence of a number in a alphanumeric string

User_BXLRVNov 15 2019 — edited Nov 15 2019

Db version : 12c

Requirement : Need to find the first occurrence of a number in a alphanumeric string

Example : select to_number(regexp_substr('65DFIT15452', '[0-9]')) from dual;

In this case 65DFIT15452 is the string but i use the query like above its extracting 6 which is wrong i want the first occurrence of a number even if its 90 digit number(I mean number can be 1 digit or any number of digits) before any alphabets

Thanks in advance.

This post has been answered by Paulzip on Nov 15 2019
Jump to Answer
Comments
Post Details
Added on Nov 15 2019
5 comments
8,637 views