Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Help
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_idWhy 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
![]() |
![]() |