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!

SQL query to extract only numbers from a string variable

Karthik K-OracleJan 12 2016 — edited Jan 12 2016

Dear All Experts,

I have got a requirement in one of my project where in I have to extract only numbers present in the variable.

for example:

BANK_ACCOUNT_NUMBER = '12345-67890';

BANK_ACCOUNT_NUMBER = '12345 67890';

BANK_ACCOUNT_NUMBER = '123.456.7890';

BANK_ACCOUNT_NUMBER = '123-A456BC7890D';


In all these cases, I need to retrieve only numbers such that BANK_ACCOUNT_NUMBER = 1234567890 and I am looking for SQL query only.


Please suggest me the query how to fetch the numeric values only from a varchar variable.



Thanks,

Karthik

This post has been answered by Manik on Jan 12 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2016
Added on Jan 12 2016
3 comments
6,542 views