Oracle PL/SQL Language Pocket Reference, 4th Edition
by Steven Feuerstein, Bill Pribyl, Chip Dawes
PL/SQL Language Fundamentals
This section summarizes the fundamental components of the PL/SQL language: characters, identifiers, literals, delimiters, use of comments and pragmas, and construction of statements and blocks.
PL/SQL Character Set
The PL/SQL language is constructed from letters, digits, symbols, and whitespace, as defined in the following table:
Type | Characters |
|---|---|
Letters |
|
Digits |
|
Symbols |
|
Whitespace | space, tab, newline, carriage return |
Characters are grouped together into four lexical units: identifiers, literals, delimiters, and comments.
Identifiers
Identifiers are names for PL/SQL objects such as constants, variables, exceptions, procedures, cursors, and reserved words. Identifiers have the following characteristics:
Can be up to 30 characters in length
Cannot include whitespace (space, tab, carriage return)
Must start with a letter
Can include a dollar sign (
$), an underscore (_), and a pound sign (#)Are not case-sensitive
Using PL/SQL’s reserved words as identifiers in your programs is not a good idea and can result in compilation or runtime errors that are difficult to troubleshoot.
Tip
Earlier editions of this book included a list of reserved words. However, Oracle Database 11g Release 1 has more than 1600 reserved words as listed in the V$RESERVED_WORDS data dictionary view. In our testing we determined that more than 650 of these could not be used as procedure names or variable names. Consult V$RESERVED_WORDS for the full list of unsupported ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access