Skip to Main Content
Oracle SQL*Plus Pocket Reference
book

Oracle SQL*Plus Pocket Reference

by Jonathan Gennick
April 2000
Intermediate to advanced content levelIntermediate to advanced
94 pages
1h 52m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL*Plus Pocket Reference

SQL*Plus Format Elements

The COLUMN, ACCEPT, SET NUMBER, TTITLE, BTITLE, REPHEADER, and REPFOOTER commands allow you to control data formats using what is called a format specification. A format specification is a string of characters that tells SQL*Plus exactly how to format a number, date, or text string when it is displayed.

Formatting Numbers

Table 1.4 shows the format elements that may be used when formatting numeric output.

Table 1-4. Numeric Format Elements

Format

Element

Function

9

Represents a digit in the output.

0

Marks the spot at which you want to begin displaying leading zeros.

$

Includes a leading dollar sign in the output.

,

Places a comma in the output.

.

Marks the location of the decimal point.

B

Forces zero values to be displayed as blanks.

MI

Adds a trailing negative sign to a number and may be used only at the end of a format string.

S

Adds a + or - sign[a] to the number and may be used at either the beginning or end of a format string.

PR

Causes negative values to be displayed within angle brackets. For example, -123.99 will be displayed as <123.99>.

D

Marks the location of the decimal point.

G

Places a group separator (usually a comma) in the output.

C

Marks the place where you want the ISO currency indicator to appear. For U.S. dollars, this will be USD.

L

Marks the place where you want the local currency indicator to appear. For U.S. dollars, this will be the dollar sign character.

V

Displays scaled values. The number of digits to the right of the V indicates ...

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 SQL*Plus Pocket Reference, 3rd Edition

Oracle SQL*Plus Pocket Reference, 3rd Edition

Jonathan Gennick
Expert Oracle Exadata

Expert Oracle Exadata

Kerry Osborne, Randy Johnson, Tanel Pöder

Publisher Resources

ISBN: 1565929411Catalog PageErrata