Home

Output parameters should be assigned

Rule description

  • Output parameters should be assigned

 

Non-compliant Code Example

function GetCompleteCustomerDetails(customerId In INTEGER,
FirstName out nvarchar2,            
LastName out nvarchar2,             
Area out nvarchar2,                 
City out nvarchar2)return nvarchar2         --Non compliant code (Output parameters are not assigned)
IS
BEGIN
	Select FIRSTNAME, LASTNAME, AREA, CITY Into FirstName, LastName, Area FROM CUSTOMERS;
	RETURN(CONCAT(CONCAT(ADDRESS1,ADDRESS2),CONCAT(Area,City))); 
END GetCompleteCustomerDetails

Compliant Code Example

function GetCompleteCustomerDetails(customerId In INTEGER,
FirstName out nvarchar2,            
LastName out nvarchar2,             
Area out nvarchar2,                 
City out nvarchar2)return nvarchar2         --Compliant code (Output parameters are assigned)
IS
BEGIN
	Select FIRSTNAME, LASTNAME, AREA, CITY Into FirstName, LastName, Area, City FROM CUSTOMERS;
	RETURN(CONCAT(CONCAT(ADDRESS1,ADDRESS2),CONCAT(Area,City))); 
END GetCompleteCustomerDetails
Visual Expert 2020
 VEPLSQLRULE48