Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

AnchorTopTop

Think of all naming identifiers as consisting of 5 parts: Scope, Type, Primary Identifier, Modifier, and Suffix. Of the 5 elements only the primary identifier is required. All others are optional and only make the name better self documenting.




Scope

AnchorScopeScope

The scope is the locality of reference.

Examples:

LocalityDescriptionExample
gGlobalg_temp
lLocall_temp
pParameterp_parm1

Back to Top

info
  • Scope
  • iconfalse
    titleTable of Contents


    Type

  • Primary Identifier
  • Modifier
  • Suffix
  • Type AnchorTypeTypeThere are only two types, constants and variables.

    Examples:

    TypeDescriptionExampleComment
    cConstantgc_loop_crnGlobal constant
    cConstantlc_loop_crnLocal Constant
    cConstantpc_loop_crnParameter
    vVariablegv_loop_crnGlobal Variable
    vVariablelv_loop_crnLocal Variable
    vVariablepv_loop_crnParameter


    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:

    TypeDescriptionExample
    curCursorgcur_student
    vcr Cursor(variable)lvcr_student
    tblTablegtbl_student
    recRecordltrec_address

    Back to Top


    Primary Identifier AnchorPrimary IdentifierPrimary 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.

    Back to Top

    Modifier AnchorModifier

    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 IdentifierModifierPositionVariable
    addressmailingPrecedemailing_address
    phonehomePrecedehome_phone
    customer_namelastMiddlecustomer_last_name
    Back to Top

    Suffix

    AnchorSuffixSuffix

    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:

    TypeDescriptionExample
    iInput only parameterpv_num_items_i
    oOutput only parameterpv_sum_o
    ioBoth input and outputpv_sum_io
    Back to Top


    IT Analytics, SVC4010, Contact Us