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: Mon, 23 Aug 1999 14:36:40 -0400
Message-ID: <37C194B8.4B281C8A@Unforgettable.com>


Since you are in Windows (presumably running either the DOS or the Windows sqlplus client) you will automatically get a carriage return and line feed at a binary level. As long as you use the file on the Windows platform you will be ok. It is only if you transfer the file to another system (UNIX, mainframe, etc) that you'll see a difference. In that case it is the responsibility of the transfer protocol to do any upfix to the records.

Is there any specific reason why you need the cr/lf sequence? Once you create the data file, what do you do with it?

Also, it looks like you are trying to create a file with quoted strings. you'd be better off if you did it like this:

select '"'||a.frt_order||'"'
from frt.freight
where (frt_mode = 'U' or frt_mode = 'u' or frt_mode = 'C' or frt_mode = 'c');

Ken

abrusko wrote:

> I am in a Windows 95 environment, using SQL*PLUS to access
> Oracle. I'm not sure what OS Oracle is running on, but I
> want to use SQL*PLUS to execute a query to "Spool" the
> results to a text file.
>
> A version of the Query is below (I took out all of the
> columns except one so as not to waste space here):
>
> spo c:\freightproject\spool\FrtEdi;
> set termout off;
> set newpage 0;
> set space 0;
> set linesize 999;
> set pagesize 0;
> set echo off;
> set feedback off;
> set heading off;
> select '"', a.frt_order, '"'
> from frt.freight
> where (frt_mode = 'U' or frt_mode = 'u' or frt_mode = 'C'
> or frt_mode = 'c');
> spo off;
> rem remove the following lines for production
> set termout on;
> set newpage 1;
> set space 1;
> set linesize 100;
> set pagesize 24;
> set echo off;
> set feedback 6;
> set heading on;
>
> I would like for there to be a CR/LF at the end of each
> line following frt_order.





Received on Mon Aug 23 1999 - 13:36:40 CDT

Original text of this message

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