Home » SQL & PL/SQL » SQL & PL/SQL » Right Outer Join - ORA-01719 (Oracle 10.2.0.5)
Right Outer Join - ORA-01719 [message #603436] Mon, 16 December 2013 10:58 Go to next message
praveenramaswamy
Messages: 34
Registered: December 2013
Member
Is there an option instead of Right Outer Join. Because in one of my query i need to use "AND" or "OR" operation within an Right Outer Join and i get the ORA-01719 error. Can you please let me if or what kind of sub-query i can use instead of Right Outer Join
Re: Right Outer Join - ORA-01719 [message #603437 is a reply to message #603436] Mon, 16 December 2013 11:00 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: Right Outer Join - ORA-01719 [message #603439 is a reply to message #603437] Mon, 16 December 2013 11:18 Go to previous messageGo to next message
praveenramaswamy
Messages: 34
Registered: December 2013
Member
Select orde.no orde_no,
       orli.no orli_no,
       TO_CHAR(orde.created_date, 'DD/MON/YYYY') created_date,
       DECODE(orli.status,
              'V',
              'Voided',
              'R',
              'Regular',
              'F',
              'Foreign Shipment Pending',
              'C',
              'Cancelled',
              'B',
              'Back Ordered') orli_status,
       orli.prod_prds_product_code product_code,
       orli.prod_item_number item_number,
       prod.full_title prod_description,
       sum(orli.quantity) quantity,
       sum(orli.licensed_quantity) licensed_quantity,
       sum(orli.product_charge) product_charge,
       DECODE(orli.standing_order_flag, 'N', 'NO', 'Y', 'YES') standing_order_flag,
       TO_CHAR(orli.gds_date, 'DD/MON/YYYY') gds_date,
       inli.invo_no invoice_number,
       sum(ilac.net_amount) net_amount,
       orde.acco_no account_number
  From orders                        orde,
       Order_line_items              orli,
       Products                      prod,
       Invoice_line_items            inli,
       Invoice_line_item_adj_cancels ilac
 Where (trunc(orde.created_date) > add_months(trunc(sysdate), -24) And
       orli.orde_no = orde.no And
       prod.prds_product_code = orli.prod_prds_product_code And
       prod.item_number = orli.prod_item_number And
       prod.product_type not in ('BBSB', 'BBSS', 'SUB', 'PARU', 'SUBS') And
       inli.orli_orde_no(+) = orli.orde_no And inli.orli_no(+) = orli.no And
       ilac.inli_invo_no(+) = inli.invo_no And ilac.inli_no(+) = inli.no)
    OR ((orli.created_date >= &p_date or orli.modified_date >= &p_date) or
       (inli.created_date >= &p_date or inli.modified_date >= &p_date));


When i run the above query I get the error message
ORA 01719: outer join operator (+) not allowed in operand of OR or IN

So i was wondering if i can bypass the Right Outer Join condition with a sub-query. But wasnt sure how to accomplish this.
Re: Right Outer Join - ORA-01719 [message #603440 is a reply to message #603439] Mon, 16 December 2013 11:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68770
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
ORA-01719: outer join operator (+) not allowed in operand of OR or IN
 *Cause:  An outer join appears in an or clause.
 *Action: If A and B are predicates, to get the effect of (A(+) or B),
          try (select where (A(+) and not B)) union all (select where (B)).

Use ANSI joins.

Re: Right Outer Join - ORA-01719 [message #603443 is a reply to message #603440] Mon, 16 December 2013 11:39 Go to previous messageGo to next message
praveenramaswamy
Messages: 34
Registered: December 2013
Member
Thanks. I dont mean to request you to what i have to do, but is it possible can u just modify the query to very minimal extent just so that i get an idea

When i do a breakpoint to debug, its the first right outer join

[Updated on: Sat, 08 March 2014 02:11] by Moderator

Report message to a moderator

Re: Right Outer Join - ORA-01719 [message #603446 is a reply to message #603439] Mon, 16 December 2013 11:53 Go to previous message
Michel Cadot
Messages: 68770
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

So remove all what does not cause the problem from your query, post a simple test case and we can show you how to modify it.
But anyway, just use ANSI syntax.

Previous Topic: PLS-00103: Encountered the symbol "end-of-file" ...
Next Topic: Materialized View on Remote DB
Goto Forum:
  


Current Time: Thu Sep 04 18:26:13 CDT 2025