rspec/rules/S1745/rule.adoc

22 lines
669 B
Plaintext

== Why is this an issue?
An ``++INSERT++`` statement that does not explicitly list the columns being inserted into, as well as the values being inserted, is dependent for correct functioning on the structure of the table not changing. Additionally, not having the explicit column list degrades the readability and understandability of the code. Therefore, ``++INSERT++`` statements should always contain an explicit column list.
=== Noncompliant code example
[source,text]
----
INSERT INTO PERSONS VALUES (1, 'DUPONT', 'Marcel')
----
=== Compliant solution
[source,text]
----
INSERT INTO PERSONS (ID, LAST_NAME, FIRST_NAME)
VALUES (1, 'DUPONT', 'Marcel')
----