Lesson 7 | Environment Settings for Reports |
Objective | Define the Environment Settings for SQL*Plus Reports |
Command | Description |
TTI[TLE] [printspec [text|variable] ...]|[OFF|ON] | This is the title that appears on the top of each page of a report. Printspec includes formatting commands such as CENTER , LEFT , RIGHT , SKIP 1 (Skip one line), COL n (start next text at column n), BOLD. Turn off or on current TTITLE using TTITLE OFF and TTITLE ON. |
BTI[TLE] [printspec [text|variable] ...]|[OFF|ON] | Footer that appears at the bottom of each page. Same format as TTITLE . |
BRE[AK] [ON {columnname|ROW|REPORT} [SKIP n | SKIP PAGE ] [DUP[LICATES] | NODUP[LICATES]]] | Stop the report printing whenever there is a new value in the columnname. Perform the action(s) specified and then continue. By default, the BREAK skips one line (SKIP 1 ) before beginning the next line. By default, when you specify a BREAK on a column, the column value is not repeated in subsequent rows (NODUP), until a new value is found.
|
COMP[UTE] [function [LAB[EL] text] ... OF columnname ON {columnname|ROW|REPORT} ...] | Compute group functions on columns. Value computed is printed when the corresponding break (set with the BREAK command) is hit. Group functions include COUNT, MAX, MIN, AVG, SUM, STD, VAR . |
REPF[OOTER] [PAGE] [printspec [text|variable] ...] | [OFF|ON] | Footer printed at the end of the report. Same format as TTITLE . |
REPH[EADER] [PAGE] [printspec [text|variable] ...] | [OFF|ON] | Header printed at the beginning of the report. Same format as TTITLE . |
TTITLE
, BREAK
, and COMPUTE
TITLE LEFT "Customer Purchasing" - SKIP 1 "Pq." SQL.PN0 SKIP 2 COMPUTE SUM OF TOTAL_SALE ON LASTNAME BREAK ON LASTNAME SKIP 1
TTITLE
command was continued to the second line.COMPUTE
command here tells SQL*Plus to calculate the sum of the TOTAL_SALE column when there is a break on the LASTNAME column.BREAK
command here says that the report will break on each new value of the LASTNAME column and then skip one line. TTITLE
command said to place these words, left justified on the first line of the report and then skip one line (meaning go to the next line). TTITLE
command (second line of the command) stated to print "Pg." TTITLE
contains the SQL*Plus variable called SQL.PNO.
This is one of a small handful of pre-defined variables within SQL*Plus. TTITLE
says "SKIP 2" at the end of the command.BREAK
stops printing rows and the COMPUTE
command prints its results (the sum of TOTAL_SALE). BREAK
command (SKIP 1). After this line, the next row of the report is printed. A TTITLE, BTITLE, REPHEADER or REPFOOTER
TTITLE position_clause(s) char_value position_clause(s) char_value ... BTITLE position_clause(s) char_value position_clause(s) char_value ... REPHEADER position_clause(s) char_value position_clause(s) char_value ... REPFOOTER position_clause(s) char_value position_clause(s) char_value ...