Home » RDBMS Server » Server Utilities » Loading two files into same table using single loader
Loading two files into same table using single loader [message #70911] Mon, 12 August 2002 19:53 Go to next message
Deborah
Messages: 18
Registered: June 2002
Junior Member
Table1 has 10 fields- field1, field2...field10.

I need to load this table from two different files.
field1, field2 ... field5 are populated from
datfileA.dat and field6...field10 are populated
from datfileB.dat.

How can I do this using a single control file? Please
help. I am basically missing a proper syntax.

Thanks,

Debby
Re: Loading two files into same table using single loader [message #70915 is a reply to message #70911] Tue, 13 August 2002 05:05 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
try this
LOAD DATA 
  INFILE 'myfile1.dat' 
  INFILE 'myfile2.dat' 
APPEND
into table mytable
.........
.......
Re: Loading two files into same table using single loader [message #70936 is a reply to message #70915] Fri, 16 August 2002 01:00 Go to previous message
Deborah
Messages: 18
Registered: June 2002
Junior Member
=========================================
try this

LOAD DATA INFILE 'myfile1.dat' INFILE 'myfile2.dat' APPEND
into table mytable................

=========================================

Thanks for the reply and sorry for my late response.

I think what you have suggested here would work, if
I have two different files with the same structure,
and the data needs to be appended from both these
files as if they were a single file.

But what I need is, I have two data files with diff
structures. The first file contains fields first to
fifth. And therefore, the data due to load from this
file would lead to the rest of the fields: sixth to
tenth as NULL and the second file has fields from
sixth to tenth so that the rest of the fields from
first to fifth after loading would be NULLs. So after
loading the table would look something like:

f1 f2 f3 f4 f5 "" "" "" "" ""
f1 f2 f3 f4 f5 "" "" "" "" ""
f1 f2 f3 f4 f5 "" "" "" "" ""
------- ... Till data from file1 is over..
"" "" "" "" "" f6 f7 f8 f9 f10
"" "" "" "" "" f6 f7 f8 f9 f10
"" "" "" "" "" f6 f7 f8 f9 f10
------- ... Till data from file2 is over..

TIA,
Debby
Previous Topic: Converting RPT programs
Next Topic: Oracle 8.1.6 Export slowing down at "Exporting Views..."
Goto Forum:
  


Current Time: Thu May 09 16:32:15 CDT 2024