G-9114
🆓Warning
Always follow naming conventions for constants.
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 maximum constant integer := 1000; begin null; end; /
Issues
| Line | Column | Message |
|---|---|---|
| 2 | 4 |
Compliant Solution - ★★★★★
declare co_maximum constant integer := 1000; begin null; end; /
Parameters
Use parameters to customize the rule to your needs.
| Parameter | Description | Default Value |
|---|---|---|
| ConstantPattern | Regular expression pattern for PL/SQL constants. | (?i)^co_[a-z0-9$#_]+$ |
References
- same as plsql:NamingConstantsCheck