Sql*Plus User’s Guide and Reference


Displaying the Current Date in Titles


Download 5.34 Mb.
Pdf ko'rish
bet98/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   95   96   97   98   99   100   101   102   103
Bog'liq
E18404-12

Displaying the Current Date in Titles
You can, of course, date your reports by simply typing a value in the title. This is 
satisfactory for ad hoc reports, but if you want to run the same report repeatedly, you 
would probably prefer to have the date automatically appear when the report is run. 
You can do this by creating a variable to hold the current date.
You can reference the predefined substitution variable _DATE to display the current 
date in a title as you would any other variable.
The date format model you include in your LOGIN file or in your SELECT statement 
determines the format in which SQL*Plus displays the date. See your Oracle Database 
SQL Language Reference for more information on date format models. See 
Modifying 
Your LOGIN File
 on page 2-4 for more information about the LOGIN file.
You can also enter these commands interactively. See 
COLUMN
 on page 12-26 for 
more information.
Setting Page Dimensions
Typically, a page of a report contains the number of blank line(s) set in the NEWPAGE 
variable of the SET command, a top title, column headings, your query results, and a 
bottom title. SQL*Plus displays a report that is too long to fit on one page on several 
consecutive pages, each with its own titles and column headings. The amount of data 
SQL*Plus displays on each page depends on the current page dimensions.
The default page dimensions used by SQL*Plus are shown underneath:

number of lines before the top title: 1
Manager: 101
DEPARTMENT_ID LAST_NAME SALARY
------------- ------------------------- ----------
10 Whalen 4400
40 Mavris 6500
70 Baer 10000
100 Greenberg 12000
110 Higgins 12000
Manager: 201
DEPARTMENT_ID LAST_NAME SALARY
------------- ------------------------- ----------
20 Fay 6000
6 rows selected.


Defining Page and Report Titles and Dimensions
Formatting SQL*Plus Reports
6-25

number of lines per page, from the top title to the bottom of the page: 14

number of characters per line: 80
You can change these settings to match the size of your computer screen or, for 
printing, the size of a sheet of paper.
You can change the page length with the system variable PAGESIZE. For example, 
you may wish to do so when you print a report.
To set the number of lines between the beginning of each page and the top title, use 
the NEWPAGE variable of the SET command:
SET NEWPAGE 
number_of_lines
If you set NEWPAGE to zero, SQL*Plus skips zero lines and displays and prints a 
formfeed character to begin a new page. On most types of computer screens, the 
formfeed character clears the screen and moves the cursor to the beginning of the first 
line. When you print a report, the formfeed character makes the printer move to the 
top of a new sheet of paper, even if the overall page length is less than that of the 
paper. If you set NEWPAGE to NONE, SQL*Plus does not print a blank line or 
formfeed between report pages. 
To set the number of lines on a page, use the PAGESIZE variable of the SET command:
SET PAGESIZE 
number_of_lines
You may wish to reduce the line size to center a title properly over your output, or you 
may want to increase line size for printing on wide paper. You can change the line 
width using the LINESIZE variable of the SET command:
SET LINESIZE 
number_of_characters

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   95   96   97   98   99   100   101   102   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling