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!

Regular Expression for Invalid Number

J1604Sep 11 2013 — edited Sep 11 2013

Hi everyone,

I am using oracle version as follows:

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

------------------------------------------------------------------------

I am using regular expression to replace invalid values from a table.

I received oracle error stating "ORA-01722 invalid number"

My query looks like this:

SELECT DISTINCT

MRC_KEY,

PURPOSE_CD,

RESIDENCE_DESC,

to_number(regexp_replace(ICAP_GEN_MADAPTIVE,'[+. ]?0?0?(\d+)[-.]?','\1')) as ICAP_GEN_MADAPTIVE,

From

MRRC_INT

I am not sure what are the invalid values in the table so I can write regexp accordingly.

Any guidance is highly appreciated!

Thanks in advance

J

This post has been answered by Frank Kulash on Sep 11 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2013
Added on Sep 11 2013
14 comments
2,176 views