rspec/rules/S1740/cobol/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

27 lines
683 B
Plaintext

== Why is this an issue?
Using a scalar function or an arithmetic expression in a ``++WHERE++`` condition can prevent the database from using indexes on the relevant column(s), and could therefore lead to performance issues.
=== Noncompliant code example
[source,cobol]
----
SELECT * FROM MY_TABE WHERE C2 = C3 + :HostVar1 -- Noncompliant
SELECT * FROM MY_TABLE WHERE YEAR(BIRTHDATE) > 2000 -- Noncompliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Refactor this SQL request to eliminate [the arithmetic expression|"xxx" scalar function] in the "WHERE" clause
endif::env-github,rspecator-view[]