G-9116
🆓Warning
Always follow naming conventions for record fields.
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 r_dept_type is
record(
numéro_de_département number,
nom varchar2(30 char)
);
begin
null;
end;
/Issues
| Line | Column | Message |
|---|---|---|
| 4 | 10 |
We do not want accented letters in field names.
Compliant Solution - ★★★★★
declare
type r_dept_type is
record(
numero_de_departement number,
nom varchar2(30 char)
);
begin
null;
end;
/All accented letters are replaced with plain Latin letters.
Parameters
Use parameters to customize the rule to your needs.
| Parameter | Description | Default Value |
|---|---|---|
| FieldPattern | Regular expression pattern for PL/SQL record fields. | (?i)^[a-z0-9$#_]+$ |
References
- same as plsql:NamingRecordField