Home

INSERT statements should explicitly list the columns to be set

Rule description

  • INSERT statements should explicitly list the columns to be set

 

Non-compliant Code Example

BEGIN
	INSERT INTO	EMPLOYEE                --Non compliant code (Insert statements does not explicitly list the columns need to be set)
	VALUES (3,'Demo','Test','52 AAGMAN BUNGALOWS');
END;

Compliant Code Example

BEGIN
	INSERT INTO	EMPLOYEE(EMP_ID,FIRSTNAME,LASTNAME,ADDRESS)     --Compliant code (Insert statements explicitly list the columns need to be set)
	VALUES (3,'Demo','Test','52 AAGMAN BUNGALOWS');
END;
Visual Expert 2020
 VEPLSQLRULE142