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

Other Reporting Topics

In addition to what you’ve read so far in this chapter, there are several other techniques and topics worth discussing. One is a method for getting the current date into your page titles. Considering how easy it is to do page numbers, it’s surprisingly difficult to do dates. Report headers and footers function similarly to page headers and footers, except that they print just once, at the beginning and end of a report.

If you find yourself printing reports only because you need to look at computed values such as group totals and report totals, you will want to read the section on summary reports that follows. You can save yourself a lot of network and other overhead by summarizing your data on the server instead of returning all the detail records and making SQL*Plus do the work.

Getting the Current Date into a Header

It’s a very common practice to put the run date in the header of a report. It’s such a common practice, in fact, that it’s a wonder Oracle does not provide a convenient way to do it. Unlike the case with the page number, which SQL*Plus conveniently maintains in the SQL.PNO user variable, the date is not so easily available. How then, do you display the date in the page header? The answer is to retrieve it from the database, put it into a user variable, and display that variable in the header.

You saw how to display the contents of a user variable in the header when the Project Hours and Dollars Detail report was converted to a master/detail ...

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