rules repository

G-3115

🆓
Error

Avoid self-assigning a column.

Reason

There is normally no reason to assign a column to itself. It is either a redundant statement that should be removed, or it is a mistake where some other value was intended in the assignment.

One exception to this rule can be when you attempt to fire cross edition triggers when using Edition Based Redefinition.

Example

Non-Compliant Example

update employees
   set first_name = first_name;
Issues
LineColumnMessage
28Self-assigned column first_name.

Compliant Solution - ★★★★★

update employees
   set first_name = initcap(first_name);

References