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: Query anomaly...

Re: Query anomaly...

From: Dirk Mika <nospam_at_server.com>
Date: Thu, 08 Nov 2001 11:59:28 +0100
Message-ID: <3BEA6590.1010305@server.com>


Hi,

> At some time in the past the application that uses this database was of
> the opinion, that the CUSTOMER_ID field only contained numbers. Hidden
> somewhere in the depths of the application there was found the following
> query:
>
> SELECT * FROM CUSTOMER WHERE CUSTOMER_ID = 12345 ;
>

As far as i know oracle tries to convert every customer_id into a number to compare it with 12345. It does not convert 12345 into a varchar. So if *no* column contains any non-numeric value this query works. But if the is a non-numeric value the conversion fails. Maybe that's the difference between your two DBs.

Regards
Dirk Mika Received on Thu Nov 08 2001 - 04:59:28 CST

Original text of this message

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