Tuesday, December 24, 2013

java.sql.SQLSyntaxErrorException: ORA-01722: invalid number

This blog explains the root cause for ORA-01722 and steps need to be taken to resolve this issue.

Reason :  If you are trying to set a bind parameter value i.e String and comparing against  Numeric value you will see this error . For eg : You have empID = :BindEmpID , If you pass the :BindEmpID value as 'XYZ' then it will throw 'Invalid Number' exception because empID in database table is number field.

How to Resolve - Ensure always pass numeric values to bind paramenter when the corresponding bind parameter compares against numeric value

No comments:

Post a Comment