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: Quotes not mandatory for String condition ?

Re: Quotes not mandatory for String condition ?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 12 Jul 2005 06:08:55 -0700
Message-ID: <1121173735.221514.106350@g44g2000cwa.googlegroups.com>


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

Original text of this message

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