Re: Help Required: How can I export my Oracle data into a flat file
From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: Mon, 20 Mar 2000 16:46:36 GMT
Message-ID: <8b5kl7$if0$1_at_nnrp1.deja.com>
Using SQLPlusPlus (freeware) you could generate a script which will allow
you to export data to a flat file.
-
| 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.
-
| 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
| 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
Date: Mon, 20 Mar 2000 16:46:36 GMT
Message-ID: <8b5kl7$if0$1_at_nnrp1.deja.com>
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
+---------------------------------------------------------------| 2. SQL Link for XL => Integrate Oracle with XL
| 1. SQL PlusPlus => Add power to SQL Plus command line
| 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(Fromoracle)
> 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 - 17:46:36 CET