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!

Oracle 9, how to get the first number that occurs in a string?

CalabNov 21 2022 — edited Nov 22 2022

Unfortunately, I'm stuck accessing an Oracle 9 database so don't have the luxury of using regex. The regex that I would expect to use is '([0-9]+)'.
How can I SELECT the first integer number from an alphanumeric column in Oracle 9? Commas decimal points and spaces should break a number.
'Port #123' should return '123'.
'123 456' should return '123'.
'6 on 4 should return '6'.
'Use 3.1415 for pi' should return '3'.
'Count 1,2,3' should return '1'

Comments
Post Details
Added on Nov 21 2022
3 comments
2,199 views