G-3110: Always specify the target columns when coding an insert statement.

Major

Maintainability, Reliability

Reason

Data structures often change. Having the target columns in your insert statements will lead to change-resistant code.

Example (bad)

1
2
3
4
5
insert into department
     values (department_seq.nextval
            ,'Support'
            ,100
            ,10);

Example (good)

1
2
3
4
5
6
7
8
insert into department (department_id 
                        ,department_name
                        ,manager_id
                        ,location_id)
     values (null
            ,'Support'
            ,100
            ,10);

Note: The above good example assumes the use of an identity column for department_id.