Reputation: 1
I am using oracle 11g R2. When i query SELECT to_number('3+11+7') FROM dual. It gives ora-01722. and when i remove single quotes, SELECT to_number(3+11+7) FROM dual. Then it gives answer 21. I just removed single quotes from string. How can i do it with built in functions. Thanks.
Upvotes: 0
Views: 96
Reputation: 191305
You could pass evaluation of the expression to XML:
select to_number(xmlquery('3+11+7' returning content)) from dual;
Upvotes: 2