G-9107
🆓Warning
Always follow naming conventions for cursor parameters.
Reason
PL/SQL identifiers share the same namespace as SQL identifiers. Follow naming conventions to prevent naming conflicts, improve readability, and clearly indicate the scope without forcing the use of qualified names. A common practice is to use a prefix and/or suffix to distinguish the identifier types.
Example
Non-Compliant Example
declare
cursor c_emp(in_ename in varchar2) is
select *
from emp
where ename like in_ename;
begin
null;
end;
/Issues
| Line | Column | Message |
|---|---|---|
| 2 | 17 |
Compliant Solution - ★★★★★
declare
cursor c_emp(p_ename in varchar2) is
select *
from emp
where ename like p_ename;
begin
null;
end;
/Parameters
Use parameters to customize the rule to your needs.
| Parameter | Description | Default Value |
|---|---|---|
| CursorParameterPattern | Regular expression pattern for PL/SQL cursor parameters. | (?i)^p_[a-z0-9$#_]+$ |