|SQL*Plus User's Guide and Reference
Command Reference, 37 of 52
Places and formats a specified report header at the top of each report, or lists the current REPHEADER definition.
where printspec represents one or more of the following clauses used to place and format the text:
Refer to the following list for a description of each term or clause. These terms and clauses also apply to the REPFOOTER command.
To print one of these values, reference the appropriate variable in the report header or footer. You can format variable with the FORMAT clause.
LE[FT] CE[NTER] R[IGHT]
Left-align, center, and right-align data on the current line respectively. SQL*Plus aligns following data items as a group, up to the end of the printspec or the next LEFT, CENTER, RIGHT, or COL command. CENTER and RIGHT use the SET LINESIZE value to calculate the position of the data item that follows.
Specifies a format model that determines the format of following data items, up to the next FORMAT clause or the end of the command. The format model must be a text constant such as A10 or $999. See COLUMN FORMAT for more information on formatting and valid format models.
If the datatype of the format model does not match the datatype of a given data item, the FORMAT clause has no effect on that item.
If no appropriate FORMAT model precedes a given data item, SQL*Plus prints NUMBER values according to the format specified by SET NUMFORMAT or, if you have not used SET NUMFORMAT, the default format. SQL*Plus prints DATE values according to the default format.
Enter REPHEADER with no clauses to list the current REPHEADER definition.
If you do not enter a printspec clause before the text or variables, REPHEADER left justifies the text or variables.
You can use any number of constants and variables in a printspec. SQL*Plus displays the constants and variables in the order you specify them, positioning and formatting each constant or variable as specified by the printspec clauses that precede it.
To define "EMPLOYEE LISTING REPORT" as a report header on a separate page, and to center it, enter:
SQL> REPHEADER PAGE CENTER 'EMPLOYEE LISTING REPORT' SQL> TTITLE RIGHT 'Page: ' FORMAT 999 SQL.PNO SQL> SELECT ENAME, SAL 2 FROM EMP 3 WHERE SAL > 2000; Page: 1 EMPLOYEE LISTING REPORT Page: 2 ENAME SAL ---------- ---------- JONES 2975 BLAKE 2850 CLARK 2450 SCOTT 3000 KING 5000 FORD 3000 6 rows selected.
To suppress the report header without changing its definition, enter: