Home » RDBMS Server » Server Utilities » IMPDP: How to update table, if primary-key already exists?
IMPDP: How to update table, if primary-key already exists? [message #215894] Wed, 24 January 2007 03:52 Go to next message
gaurav_knowledge
Messages: 3
Registered: January 2007
Junior Member
Hi,

I am using the impdp utility of Oracle 10g. I want that if the table to which I am importing has the same primary key as the data of .dmp file (from which I am importing), then that row in table will be updated, and if the primary key doesn't exists, that that row is inserted.

impdp allows you to specify a table_exists_action, which can be SKIP, APPEND, REPLACE or TRUNCATE. But none of them can do what I desire, i.e INSERT/UPDATE depending on (PK doesn't exists)/(PK exists). DB2 IMPORT command can do it by specifying INSERT_UPDATE. Is there a way around for this in Oracle 10g?

thanks,
Gaurav
Re: IMPDP: How to update table, if primary-key already exists? [message #215907 is a reply to message #215894] Wed, 24 January 2007 04:37 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I believe that you'll have to import records into another (temporary) table and update existing records (or insert new ones) into the original table using SQL.
Re: IMPDP: How to update table, if primary-key already exists? [message #216058 is a reply to message #215907] Wed, 24 January 2007 20:13 Go to previous message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
...and I believe Littlefoot is right. Wink

[Updated on: Wed, 24 January 2007 20:13]

Report message to a moderator

Previous Topic: Loading data using external table .
Next Topic: How to know the tablespaces from EXP dump
Goto Forum:
  


Current Time: Wed Dec 25 21:36:27 CST 2024