| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: TO_NUMBER Problem
Buck Turgidson doodled thusly:
>I am running the following code on an 8.1.6 database, and the join on
>two numeric fields (cal_year) only works with either a to_number or
>to_char function.
>
Buck:
if you take out explicit conversions in predicates, you'll find that Oracle will take default conversions. These can take any direction and/or priority and/or default depending on what version of the software you're talking about. Ie, Oracle will NOT guarantee that without explicit datatype conversions your SQL will always default the same way.
Bottom line: always (and I mean *ALWAYS*) make sure that if you have to compare two values of different datatypes, you do an explicit conversion to one of the datatypes. And if one of the values is a column name and the other a constant/variable/bind variable, then always convert the latter. Or else index use will suffer. But I digress...
Cheers
Nuno Souto
nsouto_at_optushome.com.au.nospam
Received on Wed Feb 20 2002 - 04:14:09 CST
![]() |
![]() |