Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Querying a number column.
Matthias Rogel wrote:
> sorry sybrand, but it is not true
> (at least I checked it on 9.x):
>
> it is implicitly converted to
> column = to_number('<hardcoded numeric literal>'),
>
> where the index can be used
> (and actually is, as far as explain plan tells me)
Interesting. I just checked in Oracke 8.1.7.4 and get the same results. Oracle does a TO_NUMBER on the literal as oppose to a TO_CHAR on the column.
After a few run-ins where the opposite happened (resulting in FTSs as the index not being used), I've always stayed far away from relying on implicit conversions. That must have been back in version 7...
When I read your posting to Sybrand, I thought you were dead wrong. :-)
Even so, I would suggest always doing explicit data type conversions in SQL and never to rely on the engine/parser to guess what you actually want. I dread the day that the data type VARIANT is introduced as a column type. ;-)
-- BillyReceived on Fri Jan 24 2003 - 06:02:32 CST
![]() |
![]() |