pk1_value ora-01722 to_number error

Okey, so we have this query:

 

SELECT SEQ_NUMBER

FROM FND_ATTACHED_DOCUMENTS

WHERE PK1_VALUE = 1111;

On the test environment we got this error: ORA-01722 to_number error.

Only on the test environment. Not on production, not on development. Strange...

 

The pk1_value is varchar2(100 byte) everywhere. So that's not the problem.

When we put a single quot on the number it works again. If we do a to_char(1111) it works again.

 

But this is only a workarround. So what is the solution?

In the pk1_value column there was a value which was not a number.

So changed the value to a number value and the query worked again.

We altered the setup for the FND_ATTACHED_DOCUMENTS so pk1_value was only in use for number values.

PROBLEM SOLVED!