G-9101
🆓Warning
Always follow naming conventions for global variables.
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
create or replace package body example as some_name integer; end example; /
Issues
| Line | Column | Message |
|---|---|---|
| 2 | 4 |
Compliant Solution - ★★★★★
create or replace package body example as g_some_name integer; end example; /
Parameters
Use parameters to customize the rule to your needs.
| Parameter | Description | Default Value |
|---|---|---|
| GlobalVariablePattern | Regular expression pattern for PL/SQL global variables of any type. | (?i)^g_[a-z0-9$#_]+$ |
References
- similar to plsql:NamingVariablesCheck
The scope of plsql:NamingVariablesCheck is all variables, not just global variables.