Home

WHERE Clause

Rule description

  • DELETE and UPDATE statements should contain WHERE clause

 

Non-compliant Code Example

PROCEDURE UpdateCustomeCity(customerId in integer, city in nvarchar2(200))
IS
BEGIN
UPDATE CUSTOMERS        --Non compliant code (DELETE OR UPDATE statements without WHERE clause)
	SET City=city;
	
END UpdateCustomeCity;

Compliant Code Example

PROCEDURE UpdateCustomeCity(customerId in integer, city in nvarchar2(200))
IS
BEGIN
UPDATE CUSTOMERS        --Compliant code (DELETE OR UPDATE statements with WHERE clause)
	SET City=city
    WHERE Id = customerId;;
	
END UpdateCustomeCity;
Visual Expert 2020
 VEPLSQLRULE17