G-9111
🆓Warning
Always follow naming conventions for record type definitions.
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
type dept_typ is
record(
deptno number,
dname varchar2(14 char),
loc varchar2(13 char)
);
begin
null;
end;
/Issues
| Line | Column | Message |
|---|---|---|
| 2 | 9 |
Compliant Solution - ★★★★★
declare
type r_dept_type is
record(
deptno number,
dname varchar2(14 char),
loc varchar2(13 char)
);
begin
null;
end;
/Parameters
Use parameters to customize the rule to your needs.
| Parameter | Description | Default Value |
|---|---|---|
| RecordTypePattern | Regular expression pattern for PL/SQL record type definitions. | (?i)^r_[a-z0-9$#_]+_type$ |
References
- similar to plsql:NamingTypesCheck
The scope of plsql:NamingTypesCheck is all types, not just record types.