rspec/rules/S1745/rule.adoc

18 lines
605 B
Plaintext
Raw Normal View History

2020-12-23 14:59:06 +01:00
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.
2020-06-30 12:47:33 +02:00
== Noncompliant Code Example
----
INSERT INTO PERSONS VALUES (1, 'DUPONT', 'Marcel')
----
== Compliant Solution
----
INSERT INTO PERSONS (ID, LAST_NAME, FIRST_NAME)
VALUES (1, 'DUPONT', 'Marcel')
----