Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Quotes not mandatory for String condition ?
Patrick, Oracle will automatically attempt to perform datatype
conversion any time you compare two values of different types. Some
other database manager systems will issue an error and require you to
always code explicit conversions.
In your case Oracle where you compare a number constant to a table varchar2 Oracle is most likely converting the varchar2 column to a numeric value and then doing a number to number comparison.
Run an explain plan using dbms_xplan on both versions of the SQL.
Always code your variables and constants as the datatype of the column value you are going to compare against to prevent automatic conversion.
HTH -- Mark D Powell -- Received on Tue Jul 12 2005 - 08:08:55 CDT