Strange behaviour of "to_number"
Who can explain why
Select to_number(1) || '*' From dual
gives me "1" and
Select to_char( to_number(1) ) From dual
gives ORA-01481: invalid number format model?
Yes, I know that "1" is number, not varchar, but types are converted and if "Select to_number(1)" gives "1" and
"Select '*'" gives "*", so why their concatenation can't give "1*" :-) ?
One detail more: both "Select (to_number(1) || '*')" and "Select to_char( (to_number(1)) )" work fine.
Select to_number(1) || '*' From dual
gives me "1" and
Select to_char( to_number(1) ) From dual
gives ORA-01481: invalid number format model?
Yes, I know that "1" is number, not varchar, but types are converted and if "Select to_number(1)" gives "1" and
"Select '*'" gives "*", so why their concatenation can't give "1*" :-) ?
One detail more: both "Select (to_number(1) || '*')" and "Select to_char( (to_number(1)) )" work fine.
0