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: Help Required: How can I export my Oracle data into a flat file

Re: Help Required: How can I export my Oracle data into a flat file

From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: 2000/03/20
Message-ID: <8b5kl7$if0$1@nnrp1.deja.com>#1/1

Using SQLPlusPlus (freeware) you could generate a script which will allow
you to export data to a flat file.

SQL> EXEC S2.BLDDAT('DEPT')
| ----------------------------------------------------------------------



-
| SET HEADING OFF
| SET PAGESIZE 0
| SET TERMOUT OFF
| SET FEEDBACK OFF
| SET LINESIZE 2000
| SET TRIMSPOOL ON
| SPOOL sqlpp_dept.dat
| SELECT
| deptno||CHR(44)
| ||chr(34)||dname||chr(34)||CHR(44)
| ||chr(34)||loc||chr(34)||CHR(44)
| ||deptsal
| FROM sqlpp.dept;
| SPOOL OFF
|
| SET TERMOUT ON
PL/SQL procedure successfully completed.

You can even generate the control file required by SQL Loader to load the
data back to Oracle.

SQL> EXEC S2.BLDCTL('DEPT')
| ----------------------------------------------------------------------



-
| LOAD DATA
| INFILE 'SQLPP_DEPT.dat'
| REPLACE INTO TABLE DEPT
| FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
| TRAILING NULLCOLS(
| DEPTNO ,
| DNAME ,
| LOC ,
| DEPTSAL )
| ----------------------------------------------------------------------


-
|
| Use the following command from command line to import data back to
 oracle.
| SQLLDR USERID=sqlpp CONTROL=sqlpp_dept.ctl

PL/SQL procedure successfully completed.

regards,
M. Armaghan Saqib

+---------------------------------------------------------------

| 1. SQL PlusPlus => Add power to SQL Plus command line
| 2. SQL Link for XL => Integrate Oracle with XL
| 3. Oracle CBT with sample GL Accounting System
| Download free: http://www.geocities.com/armaghan/
 +---------------------------------------------------------------

| SQLPlusPlus now on http://www.ioug.org/
| "PL/SQL package that extends SQL*Plus to another dimension.
| Contains a PL/SQL code generator and set of extremely useful
| utilites with extensive documentation." IOUG Web Site
+---------------------------------------------------------------

PSINet News Service <Antony.Amalraj_at_tpg.com> wrote in message news:7E8A4.416$iB5.781_at_client...

> Hello All,
>
>             I am new to oracle, I want to export the table data(From
 oracle)
> alone into flat file.From the flat file I want to import the data into
> another database(db2) table.
>
> Can any one help me.
>
> Regards
> Antony





Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 20 2000 - 00:00:00 CST

Original text of this message

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