Home

VARCHAR2 should be used

Rule description

  • VARCHAR2 should be used

 

Non-compliant Code Example

DECLARE 
  firstname VARCHAR(75);          --Non compliant code (VARCHAR is used)
  lastname VARCHAR(75);           --Non compliant code (VARCHAR is used)
  landmark NVARCHAR2(75);

BEGIN
	SELECT FIRSTNAME, LASTNAME, LANDMARK 
	INTO firstname,lastname,landmark
	FROM CUSTOMERS;
END;

Compliant Code Example

DECLARE 
  firstname VARCHAR2(75);          --Compliant code (VARCHAR2 is used)
  lastname VARCHAR2(75);           --Compliant code (VARCHAR2 is used)
  landmark NVARCHAR2(75);

BEGIN
	SELECT FIRSTNAME, LASTNAME, LANDMARK 
	INTO firstname,lastname,landmark
	FROM CUSTOMERS;
END;
Visual Expert 2020
 VEPLSQLRULE71