Home » RDBMS Server » Server Utilities » i need a different "replace into" in the loader script!
i need a different "replace into" in the loader script! [message #71451] Mon, 04 November 2002 11:34 Go to next message
Till
Messages: 2
Registered: November 2002
Junior Member
ok,

i thought this should be a FAQ, but i searched the net for while and i'm still lost!
i have an external application producing plain text interface files which i load to oracle in regular intervals using sql*loader. every time a new record is produced in the application it is added to the file. everytime a record gets updated in the application, it is ALSO put into the file (with some parts of the record slightly modified).

however, if i load such data in the corresponding table using "APPEND INTO TABLE" in the loader script, SQLLDR will reject these updates since the primary key is (of course) violated.

how do i get SQLLDR to replace the existing records in the DB? i cannot use "REPLACE INTO" instead of append, thís is even worse since it empties the whole table prior to every load process!

TIA
till
Re: i need a different "replace into" in the loader script! [message #71452 is a reply to message #71451] Mon, 04 November 2002 11:43 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Actually i dont get your request.
there are two choices.
1. remove all your data before loading the new records
you can do this my
a. truncating the table before loading.
b. using replace keyword.
2. Apppend the data, which you dont want.
so you have to FIT yourself in one of these choices.

But if the constraints are annoying you during the Loading process,
there are certain methods to overcome it.
BUT IT IS NOT YOUR CASE.
pls refer to our other posting
loading tables with constraints
Re: i need a different "replace into" in the loader script! [message #71459 is a reply to message #71451] Tue, 05 November 2002 03:27 Go to previous message
Till
Messages: 2
Registered: November 2002
Junior Member
maybe i did not explain it properly, so let's try an example:

table LOGIN, primary key UID, currently 2 rows

uid fulname
-------------------------
tk till kuhn
jd john doe

now i get a new interface file with the folloing info
tk till newnane (modification of tk)
fp fred paul (new user fp)

if i use REPLACE or TRUNCATE, my existing user jd will be gone in the table! if i use APPEND, the updated record for 'tk' will be rejected ...
Previous Topic: IMP/EXP
Next Topic: recovery manager problem(urgent please)
Goto Forum:
  


Current Time: Tue May 14 08:11:13 CDT 2024