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: How does one export an Oracle table to a Comma Delimited Flat File

Re: How does one export an Oracle table to a Comma Delimited Flat File

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 09 Dec 1999 16:10:31 -0500
Message-ID: <li605s87dsiqtphuutkpnue5i5l531o4ai@4ax.com>


A copy of this was sent to budgielover_at_yahoo.com (if that email address didn't require changing) On Thu, 09 Dec 1999 20:42:16 GMT, you wrote:

>I need to export an oracle table to a csv file by using SQLPLUS
>I've tried using:
>SQL>set colsep ","
>but Oracle tabs all the columns automactically leaving unwanted spaces
>between fields
>I've also tried using:
>select col1||',',col2||',', ... from table_name;
>but it also has the spacing problem
>
>If you know how to solve this or if you know any fancy utility like bcp
>that will allow exporting table to delimited file.. that will be great!
>
>any help will be greatly appreciated!
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

see the url in my signature. I have a utility at http://osi.oracle.com/~tkyte/flat/index.html that does this. beware -- if you are using MSIIE and download the unloader.tar.gz file -- MS apparently in some releases 'auto-decompresses' the file but keeps the name unload.tar.gz -- this totallly messes up winzip. if you use MSIIE and download it and winzip says its corrupt, try renaming the download to unloader.tar (i'll put up a more permanent fix sometime)

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Dec 09 1999 - 15:10:31 CST

Original text of this message

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