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

Home -> Community -> Usenet -> c.d.o.server -> Re: Dazed and confused

Re: Dazed and confused

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 13 Oct 2003 08:56:33 -0700
Message-ID: <1066060603.962847@yasure>


mar wrote:

>"Stephan Bressler" <sbresslerx_no_spam_at_arcor.de> wrote
>
>
>
>>Hi,
>>oracle accepts comparas of char columns to numeric values, for there is
>>a conversion possible (at least sometimes).
>>I assume you get the error with xflag=1 because all those records
>>contain numeric values for xcode, while at least one of the records with
>>xflag=0 contains a non-numeric value.
>>
>>
>
>
>Thanks to all of you, guys.
>
>Actually, what is puzzling is that with XFLAG=0 I get that error
>yet I can't see anything that would prevent corresponding
>XCODE (1234567890123) to be converted successfully
>into a number.
>
>Therefore I have to ask: why can't Oracle convert string
>'1234567890123' into a valid number?
>
>It's not only '1234567890123'. The same happens with
>any combination of 13 digits. Please notice the XCODE
>field is of type CHAR(15). That means that the last two chars
>are not taken. So it has got to do something with the last
>two char positions.
>
>

The fact that implicit conversion sometimes works does not mean you should use it. It means you should
stay away from it like it is the plague because there are plenty of times it doesn't work.

Also you should never use a CHAR column as Oracle pads all entries to a full 15 characters which
introduces still more problems with string comparisons.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Oct 13 2003 - 10:56:33 CDT

Original text of this message

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