Skip to Main Content
Oracle SQL*Plus: The Definitive Guide
book

Oracle SQL*Plus: The Definitive Guide

by Jonathan Gennick
March 1999
Intermediate to advanced content levelIntermediate to advanced
528 pages
14h 39m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL*Plus: The Definitive Guide

Appendix B. SQL*Plus Format Elements

Several SQL*Plus 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. The most notable of these commands is the COLUMN command, which is used to format columns of output from a SELECT query. There are other commands as well. The complete list of SQL*Plus commands that accept format specification strings is shown here:

ACCEPT

Prompts the user to enter a value from the keyboard.

COLUMN

Controls various aspects of the way a column of data is displayed.

SET NUMBER

Defines the default display format for numbers.

TTITTE, BTITLE, REPHEADER, REPFOOTER

These commands all allow number format specifications to control the way numbers are formatted in page headers, page footers, report headers, and report footers.

There are three different, broad types of values SQL*Plus can format: numbers, character strings, and dates. Not all commands can handle each type. With most commands, you can only specify number and date formats. The COLUMN command is a good example. The ACCEPT command is the only one that allows you to specify a date format string.

Format specification strings are made up of special characters that have meaning to SQL*Plus in the context of formatting a value for display. Numeric format strings, for example, tend to have lots of 0s, 9s, decimal points, and dollar signs. Date ...

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: The Definitive Guide, 2nd Edition

Oracle SQL*Plus: The Definitive Guide, 2nd Edition

Jonathan Gennick
Oracle PL/SQL Programming, Third Edition

Oracle PL/SQL Programming, Third Edition

Steven Feuerstein, Bill Pribyl
Oracle SQL

Oracle SQL

Dan Hotka

Publisher Resources

ISBN: 1565925785Supplemental ContentCatalog PageErrata