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

Formatting Reports

SQL*Plus reports are columnar in nature. SQL*Plus provides you with the ability to define column headings and display formats for each column in a report. You may also define page headers and footers, page and line breaks, and summary calculations such as totals and subtotals.

Column Headings

Specify column headings using the HEADING clause of the COLUMN command:

COLUMN employee_name HEADING "Employee Name"

Either single or double quotes may be used to enclose the heading text. The resulting heading will look like this:

Employee Name
-------------

To specify a multiline heading, use the vertical bar (|) character to specify the location of the line break. For example:

COLUMN employee_name HEADING "Employee|Name"

The resulting multiline heading will look like this:

Employee
Name
---------

Headings of text columns are aligned to the left. Headings of numeric columns are aligned to the right. Use the JUSTIFY clause to alter that behavior:

COLUMN employee_name HEADING "Employee|Name" -
   JUSTIFY RIGHT
COLUMN employee_name HEADING "Employee|Name" -
   JUSTIFY CENTER

Use SET HEADSEP to change the line-break character to something other than a vertical bar. Use SET UNDERLINE to change the underline character to something other than a hyphen.

Column Formats

Specify display formats using the FORMAT clause of the COLUMN command. For numeric fields, format specifications can be quite detailed—controlling the length, the number of decimal places, and the punctuation used in the number. For ...

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