Reputation: 22652
I have following query
SELECT T1.col2
FROM T1
LEFT OUTER JOIN T2
ON ',' + T2.col2 + ',' LIKE '%,' + T1.col1 + ',%'
There are no numbers involved in it. Still it is showing following error
ORA-01722: invalid number : SELECT T1.col2 FROM T1 LEFT OUTER JOIN T2 ON ',' + T2.col2 + ',' LIKE '%,' + T1.col1 + ',%'
How can we fix it?
REFERENCES
Upvotes: 0
Views: 1753
Reputation: 340
The + operator expects numbers as it's operands. If you give it strings then they are invalid numbers. So it is technically correct, the best kind of correct.
Welcome to Oracle. :D
Upvotes: 1
Reputation: 22652
I am new to Oracle and it was an incorrect syntax. We need to use ||
instead of +
. The concatenation operator is different than SQL Server
However, the message ORA-01722: invalid number
seems to be misleading
Upvotes: 2