rspec/rules/S2457/plsql/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

42 lines
975 B
Plaintext

== Why is this an issue?
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.
=== Noncompliant code example
[source,sql]
----
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)
=== Message
Remove this "CROSS JOIN" query
endif::env-github,rspecator-view[]