rspec/rules/S1496/abap/rule.adoc

33 lines
673 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
``++UPDATE dbtab SET ...++`` without a ``++WHERE++`` condition changes all the entries of the table. Check whether dataset to be changed can be limited by a suitable ``++WHERE++`` condition.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2021-04-28 16:49:39 +02:00
----
UPDATE COUNTRIES SET NAME=country_name.
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2021-04-28 16:49:39 +02:00
----
UPDATE COUNTRIES SET NAME=country_name WHERE CODE=country_code.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add a "WHERE" clause to this "UPDATE" statement to prevent updating all rows in table "XXX".
endif::env-github,rspecator-view[]