Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Querying a number column.

Re: Querying a number column.

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Fri, 24 Jan 2003 12:02:32 +0000
Message-ID: <b0r301$r29$1@ctb-nnrp2.saix.net>


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. ;-)

--
Billy
Received on Fri Jan 24 2003 - 06:02:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US