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 -> PL/SQL Help

PL/SQL Help

From: Googles <google_at_earthlink.net>
Date: 18 Oct 2004 12:51:40 -0700
Message-ID: <a92dd22c.0410181151.1a30a9e8@posting.google.com>


Need help with this statement. It hangs in SQL*Plus. There is an outer join between invoice_header table and ship_addr table. SELECT invoice_detail.prod_id, invoice_detail.quantity, product.description, ship_addr.country AS stcountry   FROM invoice_header, invoice_detail, ship_addr, product   WHERE invoice_header.inv_id IN ('2002780','2002781') AND

    invoice_header.cust_id = ship_addr.cust_id(+) AND 
    invoice_header.ship_id = ship_addr.ship_id(+) AND
    invoice_header.inv_id = invoice_detail.inv_id AND 
    invoice_detail.prod_id = product.prod_id 
Why did the above statement hang?

fyi... These 2 statements below work
1) When only one inv_id is in the condition SELECT invoice_detail.prod_id, invoice_detail.quantity, product.description, ship_addr.country AS stcountry   FROM invoice_header, invoice_detail, ship_addr, product   WHERE invoice_header.inv_id IN ('2002780') AND

    invoice_header.cust_id = ship_addr.cust_id(+) AND 
    invoice_header.ship_id = ship_addr.ship_id(+) AND
    invoice_header.inv_id = invoice_detail.inv_id AND 
    invoice_detail.prod_id = product.prod_id

2) When the outer join is taken out
SELECT invoice_detail.prod_id, invoice_detail.quantity, product.description
  FROM invoice_header, invoice_detail, product   WHERE invoice_header.inv_id IN ('2002780','2002781') AND     invoice_header.inv_id = invoice_detail.inv_id AND     invoice_detail.prod_id = product.prod_id

Thank you. Received on Mon Oct 18 2004 - 14:51:40 CDT

Original text of this message

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