Home » SQL & PL/SQL » SQL & PL/SQL » How to "unload/save" a complete table content into a file ?
How to "unload/save" a complete table content into a file ? [message #221218] Sun, 25 February 2007 12:23 Go to next message
pstein
Messages: 7
Registered: February 2007
Junior Member
Assume I have a table with contents
which is a result of a SELECT FROM WHERE statement.

Is there way to "UNLOAD" or save this table into an outside
flat/text file (not database)?

Later I would like to have the possibility to reload this previously saved contents back into the table.

Are there SQL commands for such an operation?

If not: Are there Toad commands for such an operation ?

Peter

Re: How to "unload/save" a complete table content into a file ? [message #221224 is a reply to message #221218] Sun, 25 February 2007 15:08 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Check here.
Re: How to "unload/save" a complete table content into a file ? [message #221227 is a reply to message #221224] Sun, 25 February 2007 19:41 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
If all you want to do with the data is load it back in afterward, 10g DataPump Externally Organized Tables are red-hot.

The unloaded file is not human-readable, nor can it be read with any tool but the RDBMS, but it's very fast.

Ross Leishman
Re: How to "unload/save" a complete table content into a file ? [message #222414 is a reply to message #221218] Sun, 04 March 2007 07:08 Go to previous messageGo to next message
pstein
Messages: 7
Registered: February 2007
Junior Member
@ebrian:

These tools seem to be individual workarounds with a lot of
tricks. Are there really no "official" software tools for that kind of tasks ? I would expect at least dozend of tools´.

@rleishman:

Is it possible to reload previously saved tables also into
tables on another Oracle installation of another database (version) with another user (as long as the table structure is equal - of cause) ?
Re: How to "unload/save" a complete table content into a file ? [message #222426 is a reply to message #222414] Sun, 04 March 2007 10:34 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As you've mentioned TOAD, here's a tip for you: a mouse has a right button too.

When the query is executed, bottom part of the SQL Editor contains its output. Right-click in the Data Grid area and select 'Save As' which will open Save Grid Contents window. Choose options you want and click OK once you're ready.

As you'd like to load this file into the Oracle database, I'd suggest you to use format which can easily be recognized by SQL*Loader utility (Delimited Text or Fixed Field Spacing might be OK).

You could even choose Insert Statements which would automatically add INSERT INTO command to the output.
Previous Topic: SELECT qry
Next Topic: TNS
Goto Forum:
  


Current Time: Fri Dec 09 13:44:29 CST 2016

Total time taken to generate the page: 0.15456 seconds