Data Warehouse Naming Conventions
Scope
The scope is the locality of reference.
Examples:
Locality | Description | Example |
g | Global | g_temp |
l | Local | l_temp |
p | Parameter | p_parm1 |
Type
There are only two types, constants and variables.
Examples:
Type | Description | Example | Comment |
c | Constant | gc_loop_crn | Global constant |
c | Constant | lc_loop_crn | Local Constant |
c | Constant | pc_loop_crn | Parameter |
v | Variable | gv_loop_crn | Global Variable |
v | Variable | lv_loop_crn | Local Variable |
v | Variable | pv_loop_crn | Parameter |
In addition to these scalar types, there are other data types that are supported by the PL/SQL language. They are aggregate data types, which are as follows:
Type | Description | Example |
cur | Cursor | gcur_student |
vcr | Cursor(variable) | lvcr_student |
tbl | Table | gtbl_student |
rec | Record | ltrec_address |
Primary Identifier
The primary identifier is the most important part of a name. This can be a single word or a phrase.
Examples: Account, Student, StuAddr, LearnerEnroll, etc.
Modifier
A modifier further qualifies a primary identifier to make it more readable. These modifiers can either precede or succeed a primary identifier.
Examples:
Primary Identifier | Modifier | Position | Variable |
address | mailing | Precede | mailing_address |
phone | home | Precede | home_phone |
customer_name | last | Middle | customer_last_name |
Suffix
The suffix is used to qualify the identifier further to document the usage of the variable. For example, the suffix is used to denote the type of parameter, as in IN, OUT, or INOUT.
Examples:
Type | Description | Example |
i | Input only parameter | pv_num_items_i |
o | Output only parameter | pv_sum_o |
io | Both input and output | pv_sum_io |
IT Analytics, SVC4010, Contact Us