Re: Query anomaly...

From: Dirk Mika <nospam_at_server.com>
Date: Thu, 08 Nov 2001 11:59:28 +0100
Message-ID: <3BEA6590.1010305_at_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 - 11:59:28 CET

Original text of this message