i need a different "replace into" in the loader script! [message #71451] |
Mon, 04 November 2002 11:34 |
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 #71459 is a reply to message #71451] |
Tue, 05 November 2002 03:27 |
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 ...
|
|
|