Home » RDBMS Server » Server Administration » ORA-00001: unique constraint violated
ORA-00001: unique constraint violated [message #55470] Sun, 26 January 2003 17:10 Go to next message
oracle
Messages: 9
Registered: May 2002
Junior Member
Hi GUYS,

I am trying to insert data into an existing table where some of the column values are the same some are different and its generating a error

ORA-00001: unique constraint violated

If it is violated then I need to compare the column values and make sure they are the same if not then record the difference into a file can you please send me some ideas on how to do or if you have a scripts can you please email to me for a reference.

Thanks
Re: ORA-00001: unique constraint violated [message #55482 is a reply to message #55470] Mon, 27 January 2003 06:12 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
you may 
1. to the insert using a procedure.
   write an exception (dup_val_on_index)
   something like

      BEGIN
          insert into mytable(...)
      exception 
          when dup_val_on_index then
              insert into anothertable_Notconstrained (...)
              -- or use utl_file to write the violated records into a OS file.
     END; 
2. use a simple insert statment.
   create a triggger on base table which does the same stuff above like the procedure.         

Previous Topic: drive letter change caused ORA-1078
Next Topic: Storage indexes in different Tablespaces
Goto Forum:
  


Current Time: Fri Sep 20 00:41:09 CDT 2024