Team Fly |
The set pagesize command determines the length of the page. The default page size is 14 lines. If you don't want to repeat the result headings every 14 lines, use this command. If you want your page to be 50 lines long, issue the command set pagesize 50.
The ttitle command includes a number of options. The default settings return the date and page number on every page followed by the title text centered on the next line. Multiple headings can also be produced by separating the text with the vertical bar character. The command ttitle 'Customer List | Utah' centers the text ''Customer List" on the first line followed by "Utah" on the second line.
The btitle command will center text at the bottom of the page. The command btitle 'sample.sql' places the text "sample.sql" at the bottom center of the output listing. The command btitle left 'sample.sql' results in the footer text "sample.sql" being placed at the left edge of the footer.
Quite often, you'll need to format the actual column data. The column command is used to accomplish this. Suppose we are going to select the last name from the CUSTOMERS table along with a number of other columns. We know that, by default, the last name data will take up more space than it needs. The command column cust_last_name format a12 wrap heading 'Last | Name' tells SQL*Plus that there should be only 12 characters of the last name displayed and that the column title 'Last Name' should be displayed on two separate lines.
Let's put these SQL*Plus concepts together and format the output of a SQL query. The following step-by-step instructions will lead you through a few of these basic formatting commands.
Team Fly |