Sql*Plus User’s Guide and Reference


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

Example 6–25
Setting Page Dimensions
To set the page size to 66 lines, clear the screen (or advance the printer to a new sheet 
of paper) at the start of each page, and set the line size to 70, enter the following 
commands:
SET PAGESIZE 66
SET NEWPAGE 0
SET LINESIZE 70
Now enter and run the following commands to see the results:
TTITLE CENTER 'ACME WIDGET PERSONNEL REPORT' SKIP 1 -
CENTER '01-JAN-2001' SKIP 2
Now run the following query:
COLUMN FIRST_NAME HEADING 'FIRST|NAME';
COLUMN LAST_NAME HEADING 'LAST|NAME';
COLUMN SALARY HEADING 'MONTHLY|SALARY' FORMAT $99,999;
SELECT DEPARTMENT_ID, FIRST_NAME, LAST_NAME, SALARY
FROM EMP_DETAILS_VIEW
WHERE SALARY>12000;


Storing and Printing Query Results
6-26
SQL*Plus User's Guide and Reference
Now reset PAGESIZE, NEWPAGE, and LINESIZE to their default values:
SET PAGESIZE 14
SET NEWPAGE 1
SET LINESIZE 80
To list the current values of these variables, use the SHOW command:
SHOW PAGESIZE
SHOW NEWPAGE
SHOW LINESIZE
Through the SQL*Plus command SPOOL, you can store your query results in a file or 
print them on your computer's default printer.
Storing and Printing Query Results
Send your query results to a file when you want to edit them with a word processor 
before printing or include them in a letter, email, or other document.
To store the results of a query in a file—and still display them on the screen—enter the 
SPOOL command in the following form:
SPOOL 
file_name
If you do not follow the filename with a period and an extension, SPOOL adds a 
default file extension to the filename to identify it as an output file. The default varies 
with the operating system; on most hosts it is LST or LIS. The extension is not 
appended when you spool to system generated files such as /dev/null and 
/dev/stderr. See the platform-specific Oracle documentation provided for your 
operating system for more information.
SQL*Plus continues to spool information to the file until you turn spooling off, using 
the following form of SPOOL:
SPOOL OFF

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