Home

String variables with no Size specification

Rule description

  • Size should be specified for string variables

 

Non-compliant Code Example

DECLARE
   first_name varchar2;         --Non compliant code (Column declare of varchar2 without size)
   customer_id INTEGER;
BEGIN
	UPDATE CUSTOMERS 
	SET FIRSTNAME = first_name
	WHERE Id = customer_id;
END;

Compliant Code Example

DECLARE
   first_name varchar2(25);         --Compliant code (Column declare of varchar2 with size)
   customer_id INTEGER;
BEGIN
	UPDATE CUSTOMERS 
	SET FIRSTNAME = first_name
	WHERE Id = customer_id;
END;
Visual Expert 2020
 VEPLSQLRULE5