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!

Check for duplicates before insert into

Jim PSep 20 2007 — edited Sep 21 2007

Hello,

I am doing some data conversion, from one schema to another. I am able to select the data in my cursor, but I end up with about 2500 extra records. This is just part of a script that I am working on.

Is it possible to use CASE to do this:

BEGIN
   CASE 
   WHEN column  NOT EXISTS  in table
      THEN INSERT INTO table (col1, col2, col3....)
               VALUES .................
  ELSE NULL;

I have tried playing around some with my cursor select statement using GROUP BY and HAVING, but because of the data that I am bringing in, it does not seem to help.
Please Help, I have been spinning my wheels for a few hours on this.

Thanks!
Jim P.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2007
Added on Sep 20 2007
3 comments
1,304 views