Home
Function and procedure names should comply with a naming convention
Description
This rule states that all function and procedure names should follow a specific naming convention. This naming convention should be consistent and easy to understand, and should include information about the purpose of the function or procedure. This will help to ensure that all functions and procedures are easily identifiable and can be quickly located. Additionally, this will help to reduce the chances of naming conflicts between different functions and procedures.
Key Benefits
- Consistency: Function and procedure names will be consistent and easily recognizable.
- Readability: Function and procedure names will be easy to read and understand.
- Maintainability: Function and procedure names will be easier to maintain and debug.
Non-compliant Code Example
procedure DeleteCloneCustomerById_ ( customer_Id_ in NUMBER ) --Non compliant code
IS
BEGIN
DELETE CloneCustomer where ID = customer_Id_;
COMMIT;
END DeleteCloneCustomerById_
function GetFullName_(fname in nvarchar2,lname in nvarchar2) return nvarchar2 --Non compliant code
IS
BEGIN
RETURN(CONCAT(CONCAT(fname,', '),lname));
END GetFullName_
Compliant Code Example
procedure DeleteCloneCustomerById ( customer_Id in NUMBER ) --Compliant code
IS
BEGIN
DELETE CloneCustomer where ID = customer_Id;
COMMIT;
END DeleteCloneCustomerById
function GetFullName(fname in nvarchar2,lname in nvarchar2) return nvarchar2 --Compliant code
IS
BEGIN
RETURN(CONCAT(CONCAT(fname,', '),lname));
END GetFullName