rspec/rules/S1139/abap/rule.adoc

30 lines
627 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-01-27 13:42:22 +01:00
``++DELETE FROM dbtab++`` without a ``++WHERE++`` condition deletes all the entries of the table. Check whether dataset to be deleted can be limited by a suitable WHERE condition.
2020-06-30 12:47:33 +02:00
=== Noncompliant code example
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2020-06-30 12:47:33 +02:00
----
DELETE FROM COUNTRIES.
----
=== Compliant solution
2020-06-30 12:47:33 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2020-06-30 12:47:33 +02:00
----
DELETE FROM COUNTRIES WHERE CODE = country_code.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add a "WHERE" clause to this "DELETE" statement to prevent deleting all rows in table "XXX".
endif::env-github,rspecator-view[]