Re: export to ascii file

From: <eric.san.andres_at_kellogg.com>
Date: 1997/05/06
Message-ID: <5knp8v$kf6$1_at_bilbo.reference.com>#1/1


 Try exporting the table to a file, i.e export.dmp.  Then filter the export.dmp from all the insert statements.

    # cat export.dmp|grep 'INSERT' > insert.sql  It's possible that this greps also 'GRANT INSERT' statements.  If you want, filter them even further:

    # cat insert.sql|grep -v 'GRANT' > filtered_insert.sql  These steps will just give you the idea that the export file  generated by the 'exp' utility is an ascii file.

 This is a pseudo-procedure, just giving you ideas.  Do this at your own risk. Although I've done this a couple of times  for small tables.

 Anyway, Good Luck!

Eric B. San Andres
Upp Business Systems,Inc.
eric.san.andres_at_kellogg.com
On Fri, 02 May 1997 03:42:36 GMT, lspells_at_mindspring.com (Lamar Spells) wrote:
> I think there are some important questions that must be asked here in
> order to suggest a proper solution:
>
> (1) What volume of data are you talking about? 100 Records, 1000
> Records or 1000000 Records?
>
> (2) What are you going to do with these records? Are your going to
> load them into another database, Oracle or otherwise? Are you going
> to provide this data to another system as a part of some sort of file
> based interface?
>
> I once needed to a utility to do this sort of thing... The data was to
> be moved from an Oracle 7.1.6 database on HP-UX to an IBM mainframe
> for loading into a DB2 database as well as sent to other Oracle sites.
> I am not just talking about 1000 or 10000 records-- I am talking about
> __MILLIONS__ of records.
>
> We wound up creating a program (which has about a million options) to
> (1) select the data using array processing and write it to an output
> file and (2) generate a control file that sqlldr or the DB2 load
> utility could use to load the data back. In order to do this, we
> obtained some sample code from Oracle and hacked it to do what we
> wanted. I am a little fuzzy on the details-- this has been about 1.5
> years ago.
>
> Thanks,
> Lamar Spells
> lspells_at_mindspring.com
>
> "Daniel A. Morgan" <dmorgan_at_exesolutions.com> wrote:
>
> >> I would like to know how or where I might find information on how
> >> to export a table to an ascii file in ORACLE (for example, in SYBASE
> >> I would use the following:
> >>
> >> bcp databaseName..tableName out dataFile -c .....
> >
> >A simple way, from SQL*Plus would be as follows:
> >
> >spool c:\temp\textfile.txt
> >select * from mytable;
> >spool off
> >
> >This will create an ASCII text file.
> >
> >Daniel A. Morgan
>
 

--

Posted using Reference.COM                         http://www.reference.com
Browse, Search and Post         Usenet and Mailing list Archive and Catalog.

InReference, Inc. accepts no responsibility for the content of this posting.
Received on Tue May 06 1997 - 00:00:00 CEST

Original text of this message