Formatting Oracle sqlplus output

a job extracts orcle data into unix as flat file.
a single record breaks into two record in unix flat file. This is the case only for 6 records out of 60 lack records.

(its not single record in two line. but its single record into record. ie., \n come into picture)

can you tell me what would be the problem? how can i make them single record.?

I don't understand, what's the difference?

Please post the code you're executing and an example of the output.

Huh ? And what does "record into record" mean ?
If there are newlines ("\n" characters) in a column value then you can use the REPLACE function to replace each newline to a single blank space.

Nope. Difficult to tell you unless you give more details.

tyler_durden

Problem w replace() is that it has to be nested for more than one instance of a bad character. This can get to be cumbersome if there's more than say three chars on the list. Might be best to pipe output into either tr, sed or something that can swap or reduce the chars for you as a range or a char class. Likewise on a file previously spooled, but much more difficult since you'd need to parse the file first.

Please state what Operating System and version you have.
Please state what shell you use (e.g. sh, ksh, bash).
Please post what version of Oracle you have.
Please post the script.
Please post what you typed to execute the script.
Please post sample input data (blotting anything confidential).
Please post what you expected to happen.
Please post what actually happened (including any error messages).

The answer: set linesize 999 (* or some other large size as required).
IF you don't want headings - set pages 0 stops that and page feeds.

sqlplus wraps at linesize, the default is 80.

set linesize 999
set pages 0
set trimspool on
spool someoutputfile.txt
select * from sometable;
spool off

---------- Post updated at 18:02 ---------- Previous update was at 17:57 ----------

PS: lack, lac, or lakh is a number designation that is maybe not known by a lot of the people here -- ones you really want helping you.

Could be the answer, but without a sense of the DDL or data involved I guess it really depends on the OP's actual problem. Could still be GIGO...