Oracle Development Unleashed (3rd Edition)

Previous Table of Contents Next

Page 298

Page 299

COMPUTE SUM OF monthly_sales ON sales_rep COMPUTE SUM OF commissions ON sales_rep COMPUTE SUM OF monthly_sales ON REPORT COMPUTE SUM OF commissions ON REPORT

It then skips two lines and produces monthly_sales and commissions totals at the end of the report.

NOTE
The COMPUTE command resets the accumulator fields back to zero after printing.

Miscellaneous Commands

This section presents a variety of commands that enable you to interact with the user , comment on the code, and enhance coding options. These miscellaneous commands are as follows :

TIP
I find these DEFINE statements handy for assigning a variable name to the input parameters coming into the SQL*Plus command file ”for example,

DEFINE SYSTEM_NAME = &1 This line creates a character variable SYSTEM_NAME and assigns it the text associated with the first input parameter. The DEFINE statement makes the SQL*Plus command file's code easier to follow.

Page 300

Previous Table of Contents Next

Категории