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!

Ignore illegal numbers in SQL query

161254Jan 10 2002
We have a VARCHAR2 column in a table. In a SELECT statement want to be able to do arithmetic on the values in the column provided they are valid numbers. For rows where the value is not numeric assume a zero or Null result or if that is not possible only return the rows where the value is a valid number.

Using the to_number function returns Oracle errors of
ORA-01722: invalid number

[Oracle Database is part of a package which gives us facilities to write select statements to query the package data but not write our own functions]



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2002
Added on Jan 10 2002
9 comments
748 views