Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Running SQLPlus from command line

Re: Running SQLPlus from command line

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Fri, 13 Oct 2006 15:04:10 GMT
Message-ID: <J72xv5.Azp@igsrsparc2.er.usgs.gov>


RLN wrote:

>>> Syntax error: no terminating semicolon ;  <<

> Doh! :-) ok....TEST12.txt returns output just fine form the SQL run.
> Thanks Ed, (after turning multi-shades of red in embarrassment) :-)
>
> As for formatting: the SPOOL command states:
> "Represents the name of the file to which you wish to spool. SPOOL
> followed by file_name begins spooling displayed output to the named
> file. If you do not specify an extension, SPOOL uses a default
> extension (LST or LIS on most systems)"
>
> Below is 1 record of that output.
> Are there simple ways to pre-format the text before spooling aside from
> what is delivered here or am I stuck with "whatcha see is whatcha get"?
>
>
> <begin text output>
> PROCESS_INSTANCE BUSIN VOUCHER_ VOUCHER_LINE_NUM BUSIN PO_ID
> LINE_NBR
> ---------------- ----- -------- ---------------- ----- ----------
> ----------
> SCHED_NBR BUSIN RECEIVER_I RECV_LN_NBR RECV_SHIP_SEQ_NBR MATCH_RULE
> SETID
> ---------- ----- ---------- ----------- ----------------- ----------
> -----
> MATCH_CNTR BUYER_ID MERCHANDISE_AMT QTY_VCHR
>
> ---------- ------------------------------ --------------- ----------
>
> IMAGE_REF_ID
>
> ------------
>
> 1617711 10500 01436603 1 10500 0000877894
> 1
> 1 0 1 RULE_E100
> SHARE
> STANDARD ch282836 7150 2600
>
> 9446694
>
>
> <end text output>
>

The SPOOL command takes the output of SQL*Plus and writes it to a file. As such, if you do not like the formatting, change in SQL*Plus.

To change the length of the line of output, use the following:

SET LIN xxx

Where xxx is the number of characters. The default is too short.

To change the formatting of a column (including the length of a column), use the COLUMN command in SQL*Plus.

Please refer to the SQL*Plus documentation for these two commands to see how they can help you format your report:

http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch6.htm#i1081008

You can add the SET and COLUMN commands in your script before you start the SPOOL.

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Fri Oct 13 2006 - 10:04:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US