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: SQL*PLUS spooling and CR/LF

Re: SQL*PLUS spooling and CR/LF

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Tue, 24 Aug 1999 09:25:47 -0400
Message-ID: <37C29D5B.5DEC1FC9@Unforgettable.com>


abrusko wrote:

> Thanks for the response...
>
> I added chr(13), chr(10) to the end of each row. The
> result was an unprintable character (in the form of a small
> square) at the end of each line, but there is still no
> carriage return and line feed. When I go to the end of the
> line in the spooled file, I can move the cursor to the
> right indefinitely instead of having it "jump" to the next
> line.
>
> I'm stumped...
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!

I can see that you are struggling with this and that you don't really see what is happening. It is unfortunate that you are working under windows and therefore are not used to dealing with binary contents of files.

First of all, the reason why your cursor goes right past the "square" (by the way, the "square" is the only way that notepad knows how to represent a carriage return) is because the sqlplus outputs fixed record lenghts (controlled by LINESIZE) by default. If you want to have variable length records you must either "SET TRIMOUT ON" or you must do your processing in PL/SQL and use dbms_output to write out the records.

Secondly, once you put a carriage return into a file it is no longer a text file (by DOS standards) and is only a binary file. You should never use text based tools to examine a binary file. Get something like QuickView plus so that you can set the output to be more meaningful.

What you have not yet explained is why you want to do this. What is wrong with the way that sqlplus creates a text file. Hard carriage returns are pretty meaningless in the DOS world and unless you are porting the output file to a machine which requiresthe carriage-return/linefeed sequence then there probably are not many good reasons for doing what you are trying to do unless you are just trying to prove that you can do it for the sake of your own curiosity.

Ken Received on Tue Aug 24 1999 - 08:25:47 CDT

Original text of this message

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