Home | Looking for something? Sign In | New here? Sign Up | Log out

Nov 29, 2010

The PL/SQL Character Set

The PL/SQL Character Set

A PL/SQL program consists of a sequence of statements, each of which is made up of one or more lines of text. Text is made up of combinations of the characters shown in Table.

Table : PL/SQL Character Set
Type
Characters
Letters
A-Z, a-z
Digits
0-9
Symbols
~ ! @ # $ % & * ( ) _ - + = | [ ] { } : ; " ' < > , . ? /
Whitespace
Tab, space, carriage return
Note that PL/SQL is a case-insensitive language. Uppercase letters are treated the same way as lowercase letters except when the characters are surrounded by single quotes (when they are literal strings) or represent the value of a character variable.
Every valid statement in PL/SQL, from declaration to executable statement to keyword, is made up of various combinations of the above characters. Now you just have to figure out how to put them all together!
A number of these characters -- both singly and in combination with other characters -- have a special significance in PL/SQL. Table 2 lists these special symbols.

Table 2: Simple and Compound Symbols in PL/SQL
Symbol
Description
;
Semicolon: statement terminator
%
Percent sign: attribute indicator (cursor attributes like %ISOPEN and indirect declaration attributes like %ROWTYPE). Also used as multibyte wildcard symbol, as in SQL.
_
Single underscore: single-byte wildcard symbol, as in SQL
:
Colon: host variable indicator, such as :block.item in Oracle Forms
**
Double asterisk: exponentiation operator
< > and !=
"Not equals"
||
Double vertical bar: concatenation operator
<< and >>
Label delimiters
<= and >=
Relational operators
:=
Assignment operator
=>
Association operator for positional notation
 --
Double dash: single-line comment indicator
/* and */
Beginning and ending multiline comment block delimiters
Characters are grouped together into lexical units, also called atomics of the language, because they are the smallest individual components. A lexical unit in PL/SQL is any of the following:
  • Identifier
  • Literal
  • Delimiter
  • Comment

Label