Home » RDBMS Server » Server Utilities » How to load data using SQLLDR from multiple tables.(Urgent)
icon14.gif  How to load data using SQLLDR from multiple tables.(Urgent) [message #319603] Mon, 12 May 2008 06:29 Go to next message
gangaprasad.k
Messages: 3
Registered: May 2008
Junior Member
Hi,

Assume that i have two tables tab1 and tab2.
I want to load the data into tab1 using data file "data1".
Their is one column in tab1 whose data is not available directly
in data file,whose value can found by combination of unique column in tab1(which is foreign key for tab2) and tab2.


Please help me to resolve the issue.

structure of tables
tab1
name dept_no dept_name
tab2
dept_no dept_name

here i want to load tab1(dept_name) from tab2(dept_no from tab1)
Here dept_name is not available in data file.
Re: How to load data using SQLLDR from multiple tables.(Urgent) [message #319614 is a reply to message #319603] Mon, 12 May 2008 06:43 Go to previous messageGo to next message
Littlefoot
Messages: 20895
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
One (easy) way would be to use "external tables" feature (if your database version supports it); because, doing so, you'd be able to insert records into tables using (PL/)SQL language. In your case, it would require a simple join.
Re: How to load data using SQLLDR from multiple tables.(Urgent) [message #319615 is a reply to message #319603] Mon, 12 May 2008 06:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use an external table instead of SQL*Loader, then you have the full power of SQL to load.
How to do it depends on what you have in the file, information you didn't give us.

Regards
Michel
Re: How to load data using SQLLDR from multiple tables.(Urgent) [message #319620 is a reply to message #319615] Mon, 12 May 2008 06:49 Go to previous messageGo to next message
gangaprasad.k
Messages: 3
Registered: May 2008
Junior Member
Hi Michel,

with sqlldr it is not possible.
Re: How to load data using SQLLDR from multiple tables.(Urgent) [message #319623 is a reply to message #319614] Mon, 12 May 2008 06:51 Go to previous messageGo to next message
gangaprasad.k
Messages: 3
Registered: May 2008
Junior Member
how to use external table feature.
if u have any document or any example to explain external table
concept then please send me at personal e- mail id
gangaprasad.k@polaris.co.in
Re: How to load data using SQLLDR from multiple tables.(Urgent) [message #319627 is a reply to message #319623] Mon, 12 May 2008 06:54 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://www.oracle.com/pls/db102/search?remark=quick_search&word=external+table&tab_id=&format=ranked

Regards
Michel
Re: How to load data using SQLLDR from multiple tables.(Urgent) [message #319686 is a reply to message #319623] Mon, 12 May 2008 11:06 Go to previous message
Barbara Boehmer
Messages: 8632
Registered: November 2002
Location: California, USA
Senior Member
You could also create a function that accepts the foreign key value as a parameter and returns the desired data, then use that function in your SQL*Loader control file, but if your data is large, it might not be as efficient.
Previous Topic: import database error
Next Topic: Blank fields with sql*loader
Goto Forum:
  


Current Time: Tue Dec 06 00:16:56 CST 2016

Total time taken to generate the page: 0.08779 seconds