Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DUP_VAL_ON_INDEX Problem

Re: DUP_VAL_ON_INDEX Problem

From: Mark G <mgumbs_at_nospam.hotmail.com>
Date: Thu, 1 Jul 1999 16:19:50 +0100
Message-ID: <377b84f0.0@145.227.194.253>

  1. I know it wasn't the exact code you posted but your little example had its end's in the wrong place. Try this structure.

while x%found loop
  begin

     insert (.....)
   EXCEPTION WHEN DUP_VAL_ON_INDEX THEN     update(....
  end;
  fetch another record
end loop

2. If that doesn't help, are there any other trggers on the table which may violate some constraint when you do an update?

HTH Mark

yarch_at_hotmail.com wrote in message <7lfurk$fa5$1_at_nnrp1.deja.com>...
>Help,
>I have a strange problem.......If you might have an
>idea of why it's happening, I would appreciate any
>information.
>
>my logic loops thru a cursor...if it's unique it
>inserts it...if it generates a dup_val_on_index it
>goes to the exception logic and updates...problem is
>when it does an insert, it also does an update in
>the exception block.......??????? so, for every
>record in the cursor it does the update....
>
>I looked at the index and the unique columns seem to be correct.
>can it be the way it's defined???
>
>here's the general code
>
>
>while x%found loop
>begin
> insert (.....)
> EXCEPTION
> WHEN DUP_VAL_ON_INDEX THEN
> begin
> update(....
> end
>
>fetch another record
>end
>end loop
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Thu Jul 01 1999 - 10:19:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US