tags:

views:

96

answers:

4

I have got 2 questions.

  1. Is there any way to load data to a table in Oracle from a .txt file other than using SQL loader?
  2. How to unload data from the table to a text file?

Someone please help me.

Thanks in advance.

+2  A: 
  1. Load data from txt file other than sql loader - External table,UTL_FILE package
  2. Unload data - UTL_FILE package

Use google with these key words you will find lot of information.

Pravin Satav
Hi Pravin,Thanks for the reply
Aby
In informix there is a simple function like "load from" for this purpose. What i wanted to ask is whether something like that which is simple exists in oracle or not
Aby
The closest is an EXTERNAL TABLE
Gary
A: 

Oracle has a free tool SQL Developer (http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html) you can use to do these.

Henry Gao
+1  A: 

There are a bunch of options. It depends on the context - your Oracle version, data format, is this on the client or the server, etc. Here's a quick list, there are probably many other methods:

File Input:

  • UTL_FILE
  • SQL*Loader
  • DBMS_XSLPROCESSOR.READ2CLOB
  • External Tables
  • xmltype.createXML with BFILE
  • Oracle SQL Developer or other third-party tool

File Output:

jonearles
A: 

For unloading the data you can just spool the file. In SQLPLUS create a spool file and then run a select query that reads from a table, format the data and return a string. The data will be written to the file.

Other solutions have already been mentioned. The tools including TOAD have features to create files.

Vishnu Gupta