Home

Cursors should follow a naming convention

Rule description

  • Cursors should follow a naming convention

 

Non-compliant Code Example

DECLARE
CURSOR deptCursor_ (departmentId_ INTEGER) RETURN departments%ROWTYPE IS  -- Non compliant code (Cursor is not following a naming convention)
    SELECT * FROM departments
    WHERE department_id = departmentId_;
BEGIN
  NULL;
END;

Compliant Code Example

DECLARE
CURSOR cur_dept (departmentId INTEGER) RETURN departments%ROWTYPE IS  --Compliant code (Cursor is following a naming convention)
    SELECT * FROM departments
    WHERE department_id = departmentId;
BEGIN
  NULL;
END;
Visual Expert 2020
 VEPLSQLRULE118