Home

VARCHAR2 and NVARCHAR2 should be used

Rule description

  • VARCHAR2 and NVARCHAR2 should be used

 

Non-compliant Code Example

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

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

Compliant Code Example

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

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