Sql*Plus User’s Guide and Reference


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

Creating a Flat File
When moving data between different software products, it is sometimes necessary to 
use a "flat" file (an operating system file with no escape characters, headings, or extra 
characters embedded). For example, if you do not have Oracle Net, you need to create 
a flat file for use with SQL*Loader when moving data from Oracle9i to Oracle 
Database 10g.
ACME WIDGET PERSONNEL REPORT
01-JAN-2001
FIRST LAST MONTHLY
DEPARTMENT_ID NAME NAME SALARY
------------- -------------------- ------------------------- --------
90 Steven King $24,000
90 Neena Kochhar $17,000
90 Lex De Haan $17,000
80 John Russell $14,000
80 Karen Partners $13,500
20 Michael Hartstein $13,000
6 rows selected.


Storing and Printing Query Results
Formatting SQL*Plus Reports
6-27
To create a flat file with SQL*Plus, you first must enter the following SET commands:
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF
After entering these commands, you use the SPOOL command as shown in the 
previous section to create the flat file.
The SET COLSEP command may be useful to delineate the columns. For more 
information, see the 
SET
 command on page 12-88.
Sending Results to a File
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
SQL*Plus stores all information displayed on the screen after you enter the SPOOL 
command in the file you specify.
Sending Results to a Printer
To print query results, spool them to a file as described in the previous section. Then, 
instead of using SPOOL OFF, enter the command in the following form:
SPOOL OUT
SQL*Plus stops spooling and copies the contents of the spooled file to your computer's 
standard (default) printer. SPOOL OUT does not delete the spool file after printing.

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