Home » RDBMS Server » Server Utilities » sql loader
sql loader [message #125390] Fri, 24 June 2005 16:23 Go to next message
tillu
Messages: 8
Registered: April 2005
Junior Member
Hi,
I am new to oracle. I have a doubt in using oracle sql loader.
I got 4 different text files with same format. Each file contains the top record as a header record and others as detail records.
How can I load all the header records(1st record of every file) into one table and all the detail records in other table.
Thanks,
Re: sql loader [message #125513 is a reply to message #125390] Mon, 27 June 2005 03:30 Go to previous messageGo to next message
munishmsh
Messages: 15
Registered: May 2005
Location: Bangalore
Junior Member
You can specify more than one tables and load them simultaneously
using
Load Data
Into table t1
when conditions
...
or even you can use the POSITION attribute too to load into ist table.
into table t2
.....

[Updated on: Mon, 27 June 2005 03:30]

Report message to a moderator

Re: sql loader [message #125558 is a reply to message #125513] Mon, 27 June 2005 10:26 Go to previous messageGo to next message
tillu
Messages: 8
Registered: April 2005
Junior Member
Hi thanks for the reply,
But what conditions I should give..?
If i write the control file like this

Load data
in file
'a1.txt'
'a2.txt'
'a3.txt'
into table T1
(col1 position(1:3),
col2 position(4:9)
)
when.. (what condition should I give here to load the headerline(first column of each file) in T1)

into table T2
(col1 position(1:5),
col2 position(7:10),
col3 position(11:34))
when..(Detail records loaded into this table)..


Please can u clarify it..

Thanks,
Re: sql loader [message #125571 is a reply to message #125558] Mon, 27 June 2005 15:58 Go to previous message
Barbara Boehmer
Messages: 9101
Registered: November 2002
Location: California, USA
Senior Member
You would have to figure out the conditions based upon what is unique about your header line. We cannot begin to guess that without seeing your header lines and sample data. Another alternative would be to do two separate SQL*Loader runs for each file, one using load=1 option to load only the first row into the master table and the other using skip=1 option to load everything but the first row into the detail table.
Previous Topic: export with multiple queries
Next Topic: oracle external table CHAR(255), cannot load value over 255 char
Goto Forum:
  


Current Time: Wed Dec 25 19:55:36 CST 2024