You use identifiers to name PL/SQL program items and units, which include constants, variables, exceptions, cursors, cursor variables, subprograms, and packages. Some examples of identifiers follow:
X
t2
phone#
credit_limit
LastName
oracle$number
An identifier consists of a letter optionally followed by more letters, numerals, dollar signs, underscores, and number signs. Other characters such as hyphens, slashes, and spaces are not allowed, as the following examples show:
mine&yours -- not allowed because of ampersand
debit-amount -- not allowed because of hyphen
on/off -- not allowed because of slash
user id -- not allowed because of space
Adjoining and trailing dollar signs, underscores, and number signs are allowed:
money$$$tree
SN##
try_again_
You can use upper, lower, or mixed case to write identifiers. PL/SQL is not case sensitive except within string and character literals. If the only difference between identifiers is the case of corresponding letters, PL/SQL considers them the same:
lastname
LastName -- same as lastname
LASTNAME -- same as lastname and LastName
The size of an identifier cannot exceed 30 characters. Every character, including dollar signs, underscores, and number signs, is significant. For example, PL/SQL considers the following identifiers to be different:
lastname
last_name
Identifiers should be descriptive. Avoid obscure names such as cpm. Instead, use meaningful names such as cost_per_thousand.