Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Message:Refactor this SQL to join tables with help of the JOIN keyword.
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Legacy Key:UseAnsiJoinsCheck
-
Targeted languages:RPG, T-SQL
-
Covered Languages:Cobol, PL/SQL
-
Remediation Function:Constant/Issue
-
Constant Cost:30min
Description
Since ANSI SQL-92, explicit joins using the JOIN keyword have been possible, and are preferred. Therefore table joins should be done with help of the one of the following clauses: JOIN, INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN. The old way to join tables is deprecated and should not be used anymore.
Noncompliant Code Example
SELECT * FROM PARTS, PRODUCTS WHERE PARTS.PROD = PRODUCTS.PROD
Compliant Solution
SELECT * FROM PARTS INNER JOIN PRODUCTS ON PARTS.PROD = PRODUCTS.PROD
Attachments
Issue Links
- is implemented by
-
SONARTSQL-164 Rule S1741: SQL tables should be joined with the "JOIN" keyword
-
- Open
-
-
SONARCOBOL-1056 Rule: SQL tables should be joined with the "JOIN" keyword
-
- Closed
-
1.
|
PL/SQL | RSPEC-4399 |
|
Active | Unassigned |