Home » RDBMS Server » Server Utilities » Loading multiple flat files into multiple tables
Loading multiple flat files into multiple tables [message #368204] Fri, 29 September 2000 04:30 Go to next message
Indira
Messages: 5
Registered: September 2000
Junior Member
Hi

How do you load multiple flat files which are in a folder into multiple tables using sqlloader? Please help

Thanks in advance
Indira
Re: Loading multiple flat files into multiple tables [message #368205 is a reply to message #368204] Fri, 29 September 2000 04:51 Go to previous messageGo to next message
Chella
Messages: 25
Registered: September 2000
Junior Member
If the tables are related, then you will have to load it using a single a control file otherwise you could create separate control files to keep things simple and clear. Assuming you have used SQLLOADER before, then your control file will something like this (for loading single file into a single table);

LOAD DATA
INFILE 'c:\temp\test.txt'
APPEND -- INSERT/REPLACE
INTO TABLE table1
--WHEN condition
(
CustomerID POSITION(1:6),
CustAcNumber POSITION(7:14)
)

This control file will load the data in the test.txt into the oracle table table1. You haven't given much information so this is all I could suggest. Hope this was of some help
Re: Loading multiple flat files into multiple tables [message #368208 is a reply to message #368204] Sat, 30 September 2000 01:43 Go to previous messageGo to next message
Indira
Messages: 5
Registered: September 2000
Junior Member
We can load one single file into more than one table. But I want to load a set of flat files which will be in a folder or directory. All the flat files contain similar details.

An example of a flat file is:

subject profile
faculty = algebra
jobid = 2365
marks = 98
.
.
.
.

student profile
Name = xyz
Roll no = 12365
subject = maths
.
.
.

Is it possible to load a set of these flat files in a single control file. i.e., can we specify something like *.txt in the infile statement of the control file. Because I will not be knowing the file names as they come directly into a folder.

Please help

Thanks in advance
Re: Loading multiple flat files into multiple tables [message #368209 is a reply to message #368208] Mon, 02 October 2000 03:35 Go to previous messageGo to next message
Chella
Messages: 25
Registered: September 2000
Junior Member
I am a novice to SQLLOADER and just recently got to know about it. To my knowledge, I don't think U can load multiple .TXT files using a single control file. Is the data going into one table or many ?

One suggestion would be to create x many control file (one for every flat .TXT file) and you can create a single batch file to perform the loading from all the TXT files. Try different alternatives if this doesn't work. That's how I learnt about it, trial & error! Good luck
Re: Loading multiple flat files into multiple tables [message #368212 is a reply to message #368208] Tue, 03 October 2000 01:06 Go to previous message
Indira
Messages: 5
Registered: September 2000
Junior Member
Dear Chella

Thank you for your help. I didn't get the idea of the batch file. I shall try to implement the idea.

Indira
Previous Topic: import access database on my pc to oracle on unix m/c
Next Topic: SQL LOAD - Counting records
Goto Forum:
  


Current Time: Thu Mar 28 20:17:06 CDT 2024