Re: Update problems ...
Date: 1995/07/26
Message-ID: <3v8o4h$6h9_at_dub-news-svc-1.compuserve.com>#1/1
jalford_at_immcms1.redstone.army.mil (jack) wrote:
>Hello all,
>I am trying to update a table with the statement below, I understand the
>problem, but I don't know how to find it since the table has 60,000 rows.
>Any suggestions ??
> update ammo set serial_number= rtrim(serial_number)
> where serial_number != rtrim(serial_number);
>ERROR at line 1:
>ORA-00001: unique constraint (AMMO.PRIMARY_KEY_AMMO) violated
> - jack
Maybe you have in your table two records that are currently different because of the spaces that you are trying to remove but they may become identical once you actually try to remove the spaces with your update statement.
Try finding that kind of records by
select serial_number from ammo where
serial_number=rtrim(serial_number)
That should identify rows that can cause problems in the update.
Good luck. Received on Wed Jul 26 1995 - 00:00:00 CEST