Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set parameters to format the output

Status
Not open for further replies.

w860098

Technical User
Mar 21, 2002
63
GB
I have just commenced working with Oracle (8i) and I have a specific requirement where I need to 'format' the output from a SELECT statement. [In particular, I am keen to output rows, length = 200 characters, to a spool file, with little or no accompanying text, e.g. SQL > select ....., etc.]
I have a copy of the 'Oracle8 beginner's guide', published by Osborne, and that does provide a list of the various Set commands that can be used for 'Formatting the Output' but only a few of them are described in any detail. I have looked at 2 PDFs containing the 'official' Oracle publications and can find no mention at all !
Can anyone tell me where I can find a detailed explanation for each of these Set commands ?

 
In SQL*Plus, the SPOOL command will send the screen output to a file. Example:

SQL> SET HEAD OFF <-- SUPPRESS COLUMN HEADINGS
SQL> SET PAGESIZE 2000 <-- # OF RECORDS YOU HAVE
SQL> SET LINESIZE 200 <-- WIDTH OF RECORD
SQL> SET FEEDBACK OFF <-- DO NOT SHOW ROW COUNT
SQL> spool results.lst <-- START SPOOLING TO FILENAME
SQL> select 'Your data' from dual;

Your data

SQL> spool off <-- END SPOOLING
SQL>


The results.lst file will contain:

SQL> select 'Your data' from dual;

Your data

SQL> spool off

Substitute your select statement and see if this helps.

Barbara
 
You can find all the detail explaination of the SQL*Plus SET command in the SQL*Plus User Guide and Reference - one of the Oracle documentation. in the reference -> command reference section.

comgrit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top