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: Best way to export data from multiple tables to delimited text file

Re: Best way to export data from multiple tables to delimited text file

From: Steve M <steve.mcdaniels_at_vuinteractive.com>
Date: Thu, 26 Sep 2002 12:37:22 -0700
Message-ID: <amvnjv$jf6$1@spiney.sierra.com>


I did not author this code, and wish I had the name of the person who did so I could thank them. I use this all of the time.

usage:

variable rows_exported number;
begin
  rows_exported := dump_csv( 'select * from my_table', chr(09), '/home/exports', 'my_filename.txt'); end;
/

Note: you must have UTL_FILE_DIR set correctly in your initSID.ora file.

create or replace function dump_csv(p_query varchar2, p_separator varchar2 default ',',

                                    p_dir varchar2, p_filename varchar2)
return number is
--
Received on Thu Sep 26 2002 - 14:37:22 CDT

Original text of this message

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