Newsgroups: comp.databases.oracle.server
Subject: Re: SQL*Plus spooling problem
References: <01bc1779$56ebb1e0$bcccbc8c@localhost.stl.prc.com>
"Greg Grooms" writes:
>I'm spooling data from a select statement to a file in SQL*Plus on an old
>Oracle 5 database (not my database!). The problem is with too many rows in
>the data file. The data looks OK, but the select count(*) and the wc on
>the file never match. Why would Oracle split up each row into multiple
>rows in the file?
>I have tried:
> select a, b, c from table1
> select * from table1
> select a||b||c from table1
>None work as I expect...1 line per row of data.
>Any ideas?
>Thanks
Greg,
This problem will occur not only in Oracle 5, but in 6 and 7 as well. What
is happening is once your line in the output exceeds 80 characters (the
default), Oracle will chop it into another line, adding a carriage return.
To fix this, set the linesize larger. For example,
SET LINESIZE 120
Do this in SQL*Plus before the select statement. Simply make the linesize
as large as you need.
-Ari Kaplan
Independent Oracle DBA Consultant
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> Visit my Web Page: www.arikaplan.com <->
<-> email: akaplan@interaccess.com <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Back to Ari Kaplan's Home Page