rspec/rules/S1282/cobol/rule.adoc

28 lines
479 B
Plaintext
Raw Normal View History

Having several levels of nested SQL SELECT statements makes the code difficult to read and should therefore be avoided.
== Noncompliant Code Example
With an allowed nesting level of 2:
----
*> Non-Compliant
EXEC SQL
SELECT * FROM my_table1 WHERE
my_column1 IN
(SELECT my_column2 FROM my_table2
WHERE my_column3 IN
(SELECT my_column4 FROM my_table3))
END-EXEC.
----
== Compliant Solution
----
EXEC SQL
SELECT * FROM my_table
END-EXEC.
----