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: Count of sucessfully processed rows

Re: Count of sucessfully processed rows

From: Howard J. Rogers <howardjr2000_at_yahoo.com.au>
Date: Sat, 25 Jan 2003 01:32:56 +1100
Message-ID: <B_bY9.32275$jM5.82043@newsfeeds.bigpond.com>


The easiest way would be to:

  1. disable the primary key constraint
  2. run your procedure (and thus introduce duplicate records into the table)
  3. Run the script $ORACLE_HOME/rdbms/admin/utlexcpt.sql to create a table called 'exceptions'
  4. Attempt to enable the primary key constraint with the command: alter table emp enable constraint PK_EMP exceptions into exceptions;

That will still fail to enable the constraint, but in the process of failing, it will have populated the exceptions table with the ROWIDs of every row in EMP which duplicates. You then do:

select * from emp where rowid in (select row_id from exceptions);

Now you see the EMP data itself that duplicates. (Notice, btw, the difference between the first "rowid" (without an underscore) and "row_id" (with)).

You still have to sort out the duplicates, yourself, manually. But at least you know which are the problematic rows.

Regards
HJR "Shankaran" <asshankaran_at_hotmail.com> wrote in message news:795fe36c.0301240516.68a6e453_at_posting.google.com...
> This is my problem.
> I am updating the empid column of the table emp
> as
> update table emp
> set empid = new_empid;
> somewhere it comes up with the primary key constraint error.
> Can I narrow down on the problematic row JUST by looking at the error
> variables populated by Oracle server.
> (I dont want to write a query to find the problematic row. Is there
> any way out without writing a query to findout the problematic row)
>
> Kindly help me out...
Received on Fri Jan 24 2003 - 08:32:56 CST

Original text of this message

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