rspec/rules/S2529/plsql/rule.adoc
2022-02-04 16:28:24 +00:00

42 lines
976 B
Plaintext

Developers should use the ``++FROM ... OUTER JOIN++`` syntax rather than the Oracle join operator (``+``). The reason is that outer join queries that use ``+`` are subject to several restrictions which do not apply to the ``++FROM ... OUTER JOIN++`` syntax. For instance, a ``++WHERE++`` condition containing the ``+`` operator cannot be combined with another condition using the ``++OR++`` logical operator.
== Noncompliant Code Example
[source,sql]
----
BEGIN
-- Noncompliant
SELECT *
INTO employeesArray
FROM employee, department
WHERE employee.DepartmentID = department.ID(+);
END;
/
----
== Compliant Solution
[source,sql]
----
BEGIN
-- Compliant
SELECT *
INTO employeesArray
FROM employee LEFT OUTER JOIN department
ON employee.DepartmentID = department.ID;
END;
/
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]