Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 30307 invoked from network); 20 Nov 2007 13:59:57 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by 69.64.49.119 with SMTP; 20 Nov 2007 13:59:57 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BCD317BF493;
 Tue, 20 Nov 2007 14:59:57 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 07426-03; Tue, 20 Nov 2007 14:59:57 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2BDD87BF490;
 Tue, 20 Nov 2007 14:59:57 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 20 Nov 2007 14:13:29 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id AB82E7BDCF8
 for <ORACLE-L@freelists.org>; Tue, 20 Nov 2007 14:13:29 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 32154-06 for <ORACLE-L@freelists.org>;
 Tue, 20 Nov 2007 14:13:29 -0500 (EST)
Received: from mx02.il.proquest.com (mx02.il.proquest.com [192.195.245.52])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 731BE7BDCAA
 for <ORACLE-L@freelists.org>; Tue, 20 Nov 2007 14:13:29 -0500 (EST)
X-ASG-Debug-ID: 1195586007-6f6a00c70000-34KX6p
X-Barracuda-URL: http://spam.il.proquest.com:8000/cgi-bin/mark.cgi
Received: from AABO-EXCHANGE04.bos.il.pqe (localhost [127.0.0.1])
 by mx02.il.proquest.com (Spam Firewall) with ESMTP
 id E10622FE70E; Tue, 20 Nov 2007 14:13:27 -0500 (EST)
Received: from AABO-EXCHANGE04.bos.il.pqe (aabo-exchange04.bos.il.pqe [172.24.3.208]) by mx02.il.proquest.com with ESMTP id 6ihG8bPK8zEdU7YW; Tue, 20 Nov 2007 14:13:27 -0500 (EST)
X-ASG-Whitelist: Client
Received: from AABO-EXCHANGE02.bos.il.pqe ([172.24.3.202]) by AABO-EXCHANGE04.bos.il.pqe with Microsoft SMTPSVC(6.0.3790.3959);
	 Tue, 20 Nov 2007 14:13:27 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by Ecartis
X-ASG-Orig-Subj: RE: wrong returns 
Subject: RE: wrong returns 
Date: Tue, 20 Nov 2007 14:13:22 -0500
Message-ID: <AA29A27627F842409E1D18FB19CDCF270E119391@AABO-EXCHANGE02.bos.il.pqe>
In-Reply-To: <4743231E.2090304@tufts.edu>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: wrong returns 
References: <4743231E.2090304@tufts.edu>
From: "Bobak, Mark" <Mark.Bobak@il.proquest.com>
To: <joan.hsieh@tufts.edu>,
 "oracle_l" <ORACLE-L@freelists.org>
X-OriginalArrivalTime: 20 Nov 2007 19:13:27.0659 (UTC) FILETIME=[6E17F3B0:01C82BA9]
X-Barracuda-Connect: aabo-exchange04.bos.il.pqe[172.24.3.208]
X-Barracuda-Start-Time: 1195586007
X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at il.proquest.com
X-archive-position: 3390
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Mark.Bobak@il.proquest.com
Precedence: normal
Reply-to: Mark.Bobak@il.proquest.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain

Hi Joan,

Since you mentioned 10g, this is a bit of a long shot, but, in the database where you get wrong results, try setting _table_lookup_prefetch_size = 0.  (This is a static parameter, so you'll have to bounce the instance.)  If that solves the problem, check out MetaLink Note 406966.1.

-Mark


--
Mark J. Bobak
Senior Database Administrator, System & Product Technologies
ProQuest
789 E. Eisenhower, Parkway, P.O. Box 1346
Ann Arbor MI 48106-1346
+1.734.997.4059  or +1.800.521.0600 x 4059
mark.bobak@il.proquest.com
www.proquest.com
www.csa.com

ProQuest...Start here. 


-----Original Message-----
From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] On Behalf Of Joan Hsieh
Sent: Tuesday, November 20, 2007 1:11 PM
To: oracle_l
Subject: wrong returns 

Hi,

We have one sql statement ran in two databases, both in 10g, one returns 
as following;

ID_NUMBER  Sort_Name                                                    Club
---------- ------------------------------------------------------------ 
----------------------------------------
0000110534 SMALL,JONATHAN,A. 
Fletcher Fund President's Circle
0000110535 SMALL,CORNELIA,M. 
Fletcher Fund President's Circle


In prod database, we get the same two rows come back, but the club 
column one is "NULL", it should return with the same value as above.

ID_NUMBER  Sort_Name                                                    Club
---------- ------------------------------------------------------------ 
----------------------------------------
0000110534 SMALL,JONATHAN,A. 
Fletcher Fund President's Circle
0000110535 SMALL,CORNELIA,M.

Question: both databases returns the right rows, but one column didn't 
return the value it should be. The db ran different execution plans, 
both db have very close dataset and same optimizer parameters setting. 
colud someone can shed some light why this could be wrong...

The sql statement is;
SELECT DISTINCT e.id_number
   2                ,e.pref_name_sort "Sort_Name"
   3                 ,gc.club_description "Club"
   4   FROM entity e
   5       ,tu_gift_totals tgt
   6       ,entity_record_type ert
   7       ,address pref
   8       ,(SELECT g.gift_club_id_number
   9               ,g.gift_club_status
  10               ,gct.club_description
  11           FROM gift_clubs      g
  12               ,gift_club_table gct
  13          WHERE g.gift_club_code = gct.club_code
  14            AND substr(g.gift_club_end_date, 1, 4) = '2007'
  15            AND g.gift_club_status = 'L'
  16            AND g.school_code = 'FL'
  17            AND 0 = (SELECT COUNT(*)
  18                       FROM gift_clubs      zz
  19                           ,gift_club_table gctz
  20                      WHERE zz.gift_club_code = gctz.club_code
  21                        AND zz.gift_club_id_number = 
g.gift_club_id_number
  22                        AND zz.gift_club_status = 'L'
  23                        AND zz.school_code = 'FL'
  24                        AND substr(zz.gift_club_end_date, 1, 4) = '2007'
  25                        AND gctz.club_year_type > gct.club_year_type)
  26         ) gc
  27  WHERE
  28  --Joins
  29  e.id_number = tgt.id_number(+)
  30  AND e.id_number = ert.id_number
  31  AND e.id_number = pref.id_number
  32  AND e.id_number = gc.gift_club_id_number(+)
  33  AND pref.addr_pref_ind = 'Y'
  34  AND pref.addr_status_code = 'A'
  35  AND e.record_status_code = 'A'
  36  --Input Criteria
  37  AND ert.school_code = 'FL'
  38  AND tgt.school(+) = 'FL'
  39  AND ert.class_year = '1968'
  40  --Fletcher Class Year
  41  AND
  42  (   ert.record_type_code = 'AL'
  43   OR
  44      (ert.record_type_code = 'GA' AND
  45      ert.id_number NOT IN (SELECT z.id_number
  46                                FROM entity_record_type z
  47                               WHERE z.record_type_code = 'AL'
  48                                 AND z.school_code = 'FL'))
  49   OR
  50      (ert.record_type_code = 'ST' AND ert.class_year = '2007')
  51  )
  52  -- Part of test to limit to the Small Household
  53  AND e.pref_name_sort like '%SMALL%'
  54  ORDER BY id_number;

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l


