title: ORA-01719: outer join operator (+) not allowed in operand of OR or IN
body: <p>While running my query I'm getting an error: </p>
  
  <blockquote>
    <p>ORA-01719: outer join operator (+) not allowed in operand of OR or IN
    01719. 00000 -  "outer join operator (+) not allowed in operand of OR or IN"</p>
    
    <p>Cause:    An outer join appears in an or clause.</p>
    
    <p>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))</p>
  </blockquote>
  
  <p>I'm getting this error due to my AND Or conditions under where clause which i have defined under last.</p>
  
  <pre><code>SELECT DISTINCT rp.rp_record_id,
                  rp.rate_profile_name,
                  rph.rate_type,
                  rph.charge_code,
                  rph.transport_mode,
                  rph.place_of_receipt_code,
                  rph.origin_type,
                  rph.destination_type
    FROM rate_profile rp,
         rate_profile_header rph,
         partner_charge_profile pcp,
         partner,
         commodity_codes com,
         offices,
         partner_relationships pr,
         company_partners cp,
         employee e
   WHERE        rp.rp_record_id = rph.rp_record_id
            AND pcp.partner_id = partner.partner_id
            AND rph.commcode_record_id = com.cc_record_id(+)
            AND pcp.company_id = offices.company_id
            AND offices.office_type = 'T'
            AND partner.partner_id = pr.partner_id(+)
            AND pr.employee_no = e.employee_no
            AND partner.partner_id = cp.partner_id
            AND cp.company_id = '&amp;CompanyID'
            AND cp.company_id = pcp.company_id
            AND cp.company_id(+) = pr.company_id
            AND pcp.charge_code = rph.charge_code
            AND pcp.charge_calculation_method = 'R'
            AND rph.rp_record_id = pcp.charge_rateprof_record_id
            AND (    ('&amp;psRate_type') = 'SEL'
                 AND (    rph.rate_type = 'SEL'
                      AND pcp.charge_calculation_method = 'R'
                      AND rph.rp_record_id = pcp.charge_rateprof_record_id))
         OR (    ('&amp;psRate_type') = 'BUY'
             AND (    rph.rate_type = 'BUY'
                  AND pcp.cost_calculation_method = 'R'
                  AND rph.rp_record_id = pcp.cost_rateprof_record_id))
         OR (    ('&amp;psRate_type') = 'All'
             AND (   (    rph.rate_type = 'SEL'
                      AND pcp.charge_calculation_method = 'R'
                      AND rph.rp_record_id = pcp.cost_rateprof_record_id)
                  OR (    (rph.rate_type = 'BUY')
                      AND pcp.cost_calculation_method = 'R'
                      AND rph.rp_record_id = pcp.cost_rateprof_record_id)))
  </code></pre>
  
  <p>Please suggest</p>