Trivadis / plsql-cop-validators

db* CODECOP Validators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False positive for guideline G-9002 defining a SYS_REFCURSOR

PhilippSalvisberg opened this issue · comments

When running tvdcc.sh path=. validator=com.trivadis.tvdcc.validators.TrivadisGuidelines3Plus with a file containing the following code:

DECLARE
   c_dept SYS_REFCURSOR;
BEGIN
   NULL;
END;
/

The following guideline violations are reported for line 2:

  • G-9002: Local variables should start with 'l_'.
  • G-1030: Avoid defining variables that are not used.

The first one (G-9002) is a false positive.
the second one (G-1030) is correct.

Cursor variable declarations do not work right now. However, explicit cursor declarations work. For example this:

DECLARE
   CURSOR c_dept IS SELECT * FROM dept;
BEGIN
   NULL;
END;
/