Home

PLS_INTEGER types should be used

Rule description

  • PLS_INTEGER types should be used

 

Non-compliant Code Example

DECLARE
  oracleQuery VARCHAR2(600);
  new_Custid  NUMBER(8);            --Non compliant code (Column is not of type PLS_INTEGER)
  new_FirstName   VARCHAR2(50);
  new_LastName   VARCHAR2(50);
BEGIN
	oracleQuery := 'BEGIN CreateCustomer(:id, :Fname, :Lname); END;';
	EXECUTE IMMEDIATE oracleQuery USING IN OUT new_Custid, new_FirstName, new_LastName;
END;

Compliant Code Example

DECLARE
  oracleQuery VARCHAR2(600);
  new_Custid  PLS_INTEGER;            --Compliant code (Column is of type PLS_INTEGER)
  new_FirstName   VARCHAR2(50);
  new_LastName   VARCHAR2(50);
BEGIN
	oracleQuery := 'BEGIN CreateCustomer(:id, :Fname, :Lname); END;';
	EXECUTE IMMEDIATE oracleQuery USING IN OUT new_Custid, new_FirstName, new_LastName;
END;
Visual Expert 2020
 VEPLSQLRULE177