Skip to Main Content
Oracle PL/SQL for DBAs
book

Oracle PL/SQL for DBAs

by Arup Nanda, Steven Feuerstein
October 2005
Intermediate to advanced content levelIntermediate to advanced
454 pages
14h 44m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL for DBAs

Literals

A literal is a value that is not represented by an identifier; it is simply a value.

String literals

A string literal is text surrounded by single quote characters, such as:

    'What a great language!'

Unlike identifiers, string literals in PL/SQL are case-sensitive. As you should expect, the following two literals are different.

    'Steven'
    'steven'

So the following condition evaluates to FALSE:

    IF 'Steven' = 'steven'

Numeric literals

Numeric literals can be integers or real numbers (a number that contains a fractional component). Note that PL/SQL considers the number 154.00 to be a real number of type NUMBER, even though the fractional component is zero and the number is actually an integer. Internally, integers and reals have a different representation, and there is some small overhead involved in converting between the two.

You can also use scientific notation to specify a numeric literal. Use the letter “E” (upper- or lowercase) to multiply a number by 10 to the nth power—for example, 3.05E19, 12e-5.

Beginning in Oracle Database 10g Release 1, a real can be either an Oracle NUMBER type or an IEEE 754 standard floating-point type . Floating-point literals are either binary (32-bit) (designated with a trailing F) or binary double (64-bit) (designated with a trailing D).

In certain expressions, you may use the named constants summarized in Table 1-3 as prescribed by the Institute of Electrical and Electronics Engineers (IEEE) standard.

Table 1-3. Named constants for BINARY_FLOAT and ...
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 Best Practices

Oracle PL/SQL Best Practices

Steven Feuerstein
Expert Oracle PL/SQL

Expert Oracle PL/SQL

Ron Hardman, Michael McLaughlin
Oracle PL/SQL For Dummies

Oracle PL/SQL For Dummies

Michael Rosenblum, Paul Dorsey

Publisher Resources

ISBN: 0596005873Supplemental ContentErrata Page