Skip to Main Content
Oracle PL/SQL Language Pocket Reference
book

Oracle PL/SQL Language Pocket Reference

by Bill Pribyl, Steven Feuerstein, Chip Dawes
April 1999
Intermediate to advanced content levelIntermediate to advanced
99 pages
2h 4m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL Language Pocket Reference

PL/SQL Language Fundamentals

The 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

A-Z, a-z

Digits

0-9

Symbols

~!@#$%&*()_-+=|[ ]{ }:;"'< >?/

Whitespace

space, tab, carriage return

Characters are grouped together into the 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:

  • 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

If you enclose an identifier within double quotes, then all but the first of these rules are ignored. For example, the following declaration is valid:

DECLARE
   "1 ^abc"  VARCHAR2(100);
BEGIN
   IF "1 ^abc" IS NULL THEN ...
END;

Literals

Literals are specific values not represented by identifiers. For example, TRUE, 3.14159, 6.63E-34, ‘Moby Dick', and NULL are all literals of type Boolean, number, or string. There are no date or complex datatype literals as they are internal representations. Unlike the rest of PL/SQL, literals are case-sensitive. To embed single quotes within a string literal, place two single quotes next to each other. See the following table for examples.

Literal

Actual Value

'That''s Entertainment!'

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.
Start your free trial

You might also like

Oracle PL/SQL Language Pocket Reference, 5th Edition

Oracle PL/SQL Language Pocket Reference, 5th Edition

Steven Feuerstein, Bill Pribyl, Chip Dawes
Pro Oracle Spatial for Oracle Database 11g

Pro Oracle Spatial for Oracle Database 11g

Albert Godfrind, Euro Beinat, Ravi Kothuri

Publisher Resources

ISBN: 1565924576Catalog PageErrata