Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Loader 1

Status
Not open for further replies.

newbieDev

Programmer
Jun 11, 2007
38
US
Hi Everyone,

I have an SQL Loader related question. I am expected to load about 3 tables with information that would be sent to me in one excel file. My first thought was to break this table into 3 different tables that will actually match the fields in the target table, and then create the csv data files. Is this the best way to do this, or is it better to load the 3 tables with just one data file?

If it is better to use just one data file, how will account for those duplicate values if I only want to load distinct values?

Also, I want the 3 tables updated every two weeks. Is there a way to have SQL Loader automatically update the three tables without me having to initiate the update process?


I have another table I need to do a similar thing to – will be getting one access file with data I need to load into another table in a different oracle database. This time I need to check for certain conditions:

1. If first and last name and email in the source table is equal to the first and last name, and email in another table (or DB), load all info into target table,

1. If last name and email match, then load all info but turn on a certain switch in target table
2. If only first and last match, load all info but turn on a certain switch in target table
3. If first and last name , and email don’t match , load all info but turn on a certain switch in target table

How do I code the control file to check for these conditions, and turn switch on in the target table if possible?


Explanations with examples will be greatly appreciated.

Thank you for your help in advance.


 
Using WHEN conditions in SQL*Loader will enable you to load data from the same file into multiple tables. How easy in practice this would be to do depends on the format of your input files.

SQL*Loader doesn't automatically do any updates. You would have to set up a script to call it and use something like cron to run the script at a certain time.

SQL*Loader doesn't really do complicated processing where you have to do selects against other tables in the database. You might be able to achieve what you want by putting triggers on the tables, although there would be a performance overhead in that.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top