rspec/rules/S1740/cobol/rule.adoc

27 lines
683 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
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
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
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[]