Re: What is wrong with this query?

From: TurkBear <jvgreco_at_primenet.com>
Date: 1995/05/16
Message-ID: <jvgreco.54.09E211E9_at_primenet.com>#1/1


In article <D8n7AC.6oo_at_cs.dal.ca> ae873_at_ccn.cs.dal.ca (Murray Kaiser) writes:

>Joe Nardone (joe_at_access1.digex.net) wrote:
 

>: select bill_acct_id from transmission
>: where bill_acct_id not in (select acct_id from convert_acct);
 

>I, too, use such SQL statements for exceptions reporting all the time.
 

>Are you sure that bill_acct_id and acct_id are of the same data types?
>One isn't varchar2 and the other char or number? The same size?

I think Murray's on the right track here - Varchar2 and Char have different comparison schemes ( related to blank-padding ) so check to insure that the fields in each table are identical ( format and length); otherwise try using a string function like substr(bill_acct_id,1,length) and substr(acct_id,1,same length as used for bill_acct_id) to make the comparison. The string function shouldn't add much overhead.

TurkBear
Oracle DBA
No collophon :-) Received on Tue May 16 1995 - 00:00:00 CEST

Original text of this message