|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Oracle Loader question
Hi, Im new to Oracle and Ive been asked to investigate if the following it possible and how to go about it:
Through Oracle loader, loading data into existing tables and insert the new data and replace any records with the same keys with the new data. In the Control file we can do the following: INSERT - This is the default option. It requires the table to be empty before loading. SQL*Loader terminates with an error if the table contains rows. APPEND - If data already exists in the table, SQL*Loader appends the new rows to it; if data doesn't already exist, the new rows are simply loaded. REPLACE - All rows in the table are deleted and the new data is loaded. This option requires DELETE privileges on the table. Im wondering if there is some other method of doing an append that replaces any existing records, or how this may be done. |
|
#2
|
||||
|
||||
|
I'd use a staging table and then insert/append/replace using joins to find the right data.
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
I dont suppose its possible to somehow specify a MERGE in the control file. This sounds like exactly what Im looking for.
Oracle Merge Linky |
|
#4
|
|||
|
|||
|
I found a great solution outlined here:
Linky Basically it says you can map a flat file into an external table and then use the Merge command to merge it with an existing table. Any thoughts on using this process? |
|
#5
|
||||
|
||||
|
It's a good solution, I usually prefer to load into a staging table which makes easier to perform data "scrubbing", but it should work fine.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Oracle Loader question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|