Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I use NOT EXISTS effectively to insert a new row?

586244Jul 3 2007 — edited Jul 5 2007
I'd like to insert a new record(with values fetched from a different database(DB2)) into an Oracle table only those that are not already there.
I've tried searching the forums & elsewhere...there are some SELECT examples etc...but nothing I could use. I am not that good with SQL...so any help is appreciated.
basically this is what i'd need - (mock sql...)
> insert into TABLE values(value1, value2 ...) only if not exists(select column1, column2 from TABLE where column1='value1' and column2='value2).

thanks for your time,
-Karthik.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2007
Added on Jul 3 2007
6 comments
873 views