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

Home -> Community -> Usenet -> c.d.o.server -> Re: Exporting ASCII Text file

Re: Exporting ASCII Text file

From: Lawrence <lsimela_at_mahalini.prestel.co.uk>
Date: Tue, 6 Feb 2001 03:09:59 -0000
Message-ID: <95npn2$ah6$1@phys-ma.sol.co.uk>

Looking at the SQL responses it looks like everyone neglected the cases where the column itself may contain commas. It is safest to enclose each data item with double-quotes e.g.
SELECT '"'||col1||'","'||col2||'"' from table; this would give results like
"col1_item", "col2 item with, coma"
which would be intepreted as two columns of data by Excel otherwise the comma within the second column would confuse Excel into thing there are 3 cols instead of two
You don't have to use double quotes with numeric columns just where you think the data might have commas.
What appears to be 4 single quotes in my exable are infact two single quotes enclosing a double quote

Cheers
Lawrence

Rob Diaz wrote in message ...
>How does one go about exporting an ASCII text file representation of a
 table
>from Oracle 8? (specifically, 8.0.6). We need this file to be able to
>import again (eventually) using sql*loader, as well as excel and other
>tools.
>
>Thanks in advance!
>Rob
>
>
Received on Mon Feb 05 2001 - 21:09:59 CST

Original text of this message

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