Re: Corruption in update statement with dml error logging 10gR2/Solaris

From: Vladimir M. Zakharychev <>
Date: Sun, 24 May 2009 12:00:06 -0700 (PDT)
Message-ID: <>

On May 24, 9:23 am, "Ender Wiggin" <> wrote:
> update a_table set xyz = ( SELECT distinct
>                                      FROM ... )
> log errors into err_xyz reject limit unlimited ;
> There are rows where it can possibly select upwards of 1000 rows and
> distinct will return about 5 different rows. When I update only a set of
> rows, I see that nothing gets updated to oracle error 1427, when I run the
> update statement for the whole table, I get some of the rows updated and
> others not updated. In other words, if I update a set of rows, it does not
> update any data for that set of rows. When I run this statement for the
> whole table, rows get updated for the set I just tested. Did anyone see this
> behaviour ?

From what you posted I figured that your inner query (SELECT distinct FROM ...) may return multiple rows in some cases. Update expects that for every row being updated the inner query returns exactly one row with new value(s) to be set, otherwise ORA-01427 is reported. To better understand why this happens in your case and how it can be avoided, more details are needed. Can you give an example (the data and the statement) so that we could better understand your issue and suggest appropriate fix?


   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm) Received on Sun May 24 2009 - 14:00:06 CDT

Original text of this message