Forum Stats

  • 3,874,344 Users
  • 2,266,728 Discussions
  • 7,911,829 Comments

Discussions

Oracle 9, how to find the first number within a string?

Calab
Calab Member Posts: 2 Red Ribbon
edited Nov 21, 2022 7:30PM in New To Java

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'

Apologies... I just realized that this is in 'New to Java'. I don't know how to move this message.