I have got an ID field with IDs (varchar2) like U123JAS and P239BB.
During my query I perform a like filter:
ID LIKE ('U20Q%') //works perfectly.
but: when i do:
ID LIKE ('U20%') //it fails
ErrorCode
[Error Code: 1722, SQL State: 42000] ORA-01722: invalid number
Why?
SOLUTION:
The Error was caused by (tadaa) an invalid number cast in a totally different column.
The DataRow which was causing the error only hit the second like.
Thank you all for your help, may my failure help someone else in future 😀
I think that there is a number conversion somewhere else in your query. It’s simply not evaluated in the first case, because the row that triggers the error hasn’t id beginning with
U20Q, but has id beginning withU20.When it’s necessary to convert the number, in the second case, you have a row for which it fails.
Try this: