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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to extract data from existing table to csv file.

RE: How to extract data from existing table to csv file.

From: Richard Huntley <rhuntley_at_mindleaders.com>
Date: Tue, 18 Jun 2002 09:08:24 -0800
Message-ID: <F001.00480633.20020618090824@fatcity.com>


create an sql file like this (do_csv.sql):

set heading off
set space 0
set pages 0
set linesize 0
set echo off
set feedback off
spool my_csv.csv

select '"COL1","COL2"' from dual;
select '"'||col1||'"'||','||
       '"'||col2||'"'

from csv_tab;
spool off
exit;

Then, just run this file via sqlplus -s id/pass_at_db_name @do_csv

Works like a charm...

-----Original Message-----
Sent: Monday, June 17, 2002 7:38 PM
To: Multiple recipients of list ORACLE-L

Hi All,

Could anyone tell me how to get data from existing table as a csv file using sql*plus. Appreciate any suggestions.
Thanks
Mujeeb Chowdhry

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Mujeeb Chowdhry
  INET: mujeeb.chowdhry_at_nara.gov

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Richard Huntley
  INET: rhuntley_at_mindleaders.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Jun 18 2002 - 12:08:24 CDT

Original text of this message

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