Saturday, January 26, 2013

ORA-1722: Invalid Number (#3)



ORA-1722: Invalid Number (#3)
You get this error when your SQL tries to convert a non-numeric string into a number. This conversion might be explicit – to_number(‘I am looking for trouble’) – or implicit.
This error often arises when you have a table with a varchar2 column in which you store nothing but numbers. You know that this is bad practice, but you know you will get away with it as long as you strictly store nothing but numbers in the column and all your procedures treat the contents of the column as numeric. But then, one day, you hire a new developer and, seeing that the column is varchar2, he inserts a ‘two’ – instead of 2 – into it. And suddenly all the procedures and functions that reference this column clutch their chests and die.

2 comments:

  1. This is not exactly accurate.

    We had a similar issue. Column was varchar2 but the data was all numbers. But it wouldn't allow varchar2 values. We even truncated the table and then tried to insert varchar2 values but it failed. We couldn't find what the issue was, so we ended up rebuilding the table.

    The new table had the same structure and data as the previous table (varchar2 column and all numerical data) but this time it allowed both varchar2 and numbers to be inserted.

    Another weird thing we found was that there were other databases that had this table (with the same structure & data) but none of them had any issues!

    ReplyDelete
  2. It appears that "normal 0 false false false en us x none 26" may be a formatting or encoding issue within a document or text. Camera Apps Security It's essential to review and correct page.

    ReplyDelete