Skip to Content
Oracle SQL*Plus Pocket Reference, 3rd Edition
book

Oracle SQL*Plus Pocket Reference, 3rd Edition

by Jonathan Gennick
November 2004
Intermediate to advanced
152 pages
2h 50m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL*Plus Pocket Reference, 3rd Edition

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-2 shows the format elements that may be used when formatting numeric output.

Table 1-2. Numeric format elements

Format element

Function

$

Includes a leading dollar sign in the output.

,

Places a comma in the output.

.

Marks the location of the decimal point.

0

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

9

Represents a digit in the output.

B

Forces zero values to be displayed as blanks.

C

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

D

Marks the location of the decimal point.

DATE

Causes SQL*Plus to assume that the number represents a Julian date and to display it in MM/DD/YY format.

EEEE

Causes SQL*Plus to use scientific notation to display a value. You must use exactly four Es, and they must appear at the right end of the format string.

FM

Prefix: removes any leading or trailing blanks from the return value.

G

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

L

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

MI

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

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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Oracle SQL*Plus Pocket Reference

Oracle SQL*Plus Pocket Reference

Jonathan Gennick

Publisher Resources

ISBN: 9781491926680Errata Page