Use the BTITLE command to define page footers for a report. Chapter 3 discusses BTITLE and has several examples. Also see the TTITLE command. BTITLE and TTITLE work the same way.
BTI[TLE] [[OFF|ON]| [COLx
| S[KIP]x
| TABx
| LE[FT]| CE[NTER]| R[IGHT]| BOLD| FOR[MAT]format_spec
|text
|variable
...]
where:
May be abbreviated BTI. Issuing the BTITLE command with no parameters causes SQL*Plus to display the current bottom title setting.
Turns the page footer off, but does not erase its definition. You can turn it back on again with ON.
Turns on printing of page footers. The default footer, if you do not specify another, will be the first part of the SELECT statement.
Causes any footer text following this parameter to print at the specified column position.
May be abbreviated to S, and inserts the specified number of line breaks before printing any subsequent footer text.
TAB is similar to COL, but moves you the specified number of columns relative to the current position. Negative numbers move you backwards. TAB has nothing whatsoever to do with tab characters.
May be abbreviated LE, and causes subsequent footer text to be printed beginning at the leftmost column of the current footer line.
May be abbreviated CE, and causes subsequent footer text to be centered within the current line. The LINESIZE setting controls the line width.
May be abbreviated R, and causes subsequent footer text to be printed flush right. The LINESIZE setting controls where SQL*Plus thinks the right end of the line is.
Makes your footer “bold” by printing it three times. Only title text following the BOLD command is repeated on each line. There is not a NOBOLD parameter.
May be abbreviated to FOR, and allows you to control how subsequent numeric data in the footer is displayed.
Is a string that specifies the display format to use for subsequent numeric data in the footer. The format elements you can use here are the same as for the COLUMN command, and are described in Appendix B. It is possible to specify a character format, such as A20, but that has no effect on subsequent character strings.
Is any text you want to have in the footer. To be safe, you should enclose this in quotes, but you don’t have to as long as your title text doesn’t include any keywords like BOLD or TAB that have meaning to BTITLE. Either single or double quotes may be used. If you need to include a quote as part of your text, use two quote characters back to back.
May be one of the variables shown in Table 1.1.
Table A-1. SQL*Plus System Variables
System Variable |
Value |
---|---|
SQL.PNO |
The current page number |
SQL.LNO |
The current line number |
SQL.RELEASE |
The current Oracle release |
SQL.SQLCODE |
The error code returned by the most recent SQL query |
SQL.USER |
The Oracle username of the user running the report |
When using BTITLE, you should start off with one of the keywords such as LEFT, RIGHT, or CENTER. Otherwise, if the first parameter after the command is just text, SQL*Plus will assume you have used a now-obsolete syntax for this command, and you won’t get the results you want.