totn Oracle Error Messages

Oracle / PLSQL: ORA-01719 Error Message

Learn the cause and how to resolve the ORA-01719 error message in Oracle.

Description

When you encounter an ORA-01719 error, the following error message will appear:

  • ORA-01719: outer join operator (+) not allowed in operand of OR or IN

Cause

You tried to perform a outer join when using an OR condition.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

If you've tried to use the OR condition with an outer join, you will need to re-write your SQL. You can try using a UNION ALL query to achieve the same results.

For example, if you tried to execute the following SQL statement:

SELECT suppliers.*
FROM suppliers, orders
WHERE suppliers.supplier_id = orders.supplier_id(+)
OR supplier_name = 'IBM';

You would receive the following error message:

Oracle PLSQL

You could correct this SQL statement (and achieve the same effect) with following:

SELECT suppliers.*
FROM suppliers, orders
WHERE suppliers.supplier_id = orders.supplier_id(+)
AND supplier_name <> 'IBM'
UNION ALL
SELECT suppliers.*
FROM suppliers
WHERE supplier_name = 'IBM';