Home

Record fields should comply with a naming convention

Rule description

  • Record fields should comply with a naming convention

 

Non-compliant Code Example

CREATE OR REPLACE PACKAGE BODY CUSTOMER_PACKAGE 
IS
 TYPE CUSTOMER_T IS RECORD
	( FirstName VARCHAR2(50),
	  LastName_ VARCHAR2(50), --Non compliant code (Record fields are not comply with a naming convention)
	  Area VARCHAR2(100),
	  City VARCHAR2(100));
	  
	function GetCompleteCustomerDetails(customerId In INTEGER)
		return CUSTOMER_T 
		Is
		BEGIN
			Select FIRSTNAME, LASTNAME, AREA, CITY Into CUSTOMER_T.FirstName, CUSTOMER_T.LastName, CUSTOMER_T.Area, CUSTOMER_T.City FROM CUSTOMERS Where Id = customerId;
			RETURN CUSTOMER_T; 
	END GetCompleteCustomerDetails;

END CUSTOMER_PACKAGE;

Compliant Code Example

CREATE OR REPLACE PACKAGE BODY CUSTOMER_PACKAGE 
IS
 TYPE CUSTOMER_T IS RECORD
	( FirstName VARCHAR2(50),
	  LastName VARCHAR2(50), --Compliant code (Record fields are comply with a naming convention)
	  Area VARCHAR2(100),
	  City VARCHAR2(100));
	  
	function GetCompleteCustomerDetails(customerId In INTEGER)
		return CUSTOMER_T 
		Is
		BEGIN
			Select FIRSTNAME, LASTNAME, AREA, CITY Into CUSTOMER_T.FirstName, CUSTOMER_T.LastName, CUSTOMER_T.Area, CUSTOMER_T.City FROM CUSTOMERS Where Id = customerId;
			RETURN CUSTOMER_T; 
	END GetCompleteCustomerDetails;

END CUSTOMER_PACKAGE;
Visual Expert 2020
 VEPLSQLRULE117