rspec/rules/S2457/plsql/rule.adoc

37 lines
927 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
A ``++CROSS JOIN++`` query will return all records where each row from the first table is combined with each row from the second table. This means that such a query returns the Cartesian product of the sets of rows from the joined tables, which is why it is also know as "Cartesian product query".
Such a query can return a huge amount of data, and therefore should be used only with great caution and only when really needed.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,sql]
2021-04-28 16:49:39 +02:00
----
BEGIN
-- Standard ANSI syntax
SELECT *
INTO employeeArray
FROM employee CROSS JOIN department; -- Noncompliant; explicit cross join
END;
/
BEGIN
-- Old syntax
SELECT *
INTO employeeArray
FROM employee, department; -- Noncompliant; also a cross join
END;
/
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]