Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    18

    Unanswered: ORA-00001: unique constraint violated

    Hi..

    I have faced an error as below:-
    Code:
    1 : 23000 : java.sql.BatchUpdateException: ORA-00001: unique constraint (SDS1.PK_EXP_TXT) violated
    1 : 23000 : java.sql.SQLException: ORA-00001: unique constraint (SDS1.PK_EXP_TXT) violated
    java.sql.BatchUpdateException: ORA-00001: unique constraint (SDS1.PK_EXP_TXT) violated
    	at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
    	at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9119)
    	at com.sunopsis.sql.SnpsQuery.executeBatch(Unknown Source)
    	at com.sunopsis.dwg.dbobj.SnpExpTxt.setString(Unknown Source)
    	at com.sunopsis.dwg.dbobj.SnpSession.saveText(Unknown Source)
    	at com.sunopsis.dwg.dbobj.SnpSession.updateSession(Unknown Source)
    	at com.sunopsis.dwg.dbobj.SnpSession.treatSessionPreTrt(Unknown Source)
    	at com.sunopsis.dwg.dbobj.SnpSession.treatSession(Unknown Source)
    	at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(Unknown Source)
    	at com.sunopsis.dwg.cmd.DwgCommandBase.execute(Unknown Source)
    	at com.sunopsis.dwg.cmd.e.i(Unknown Source)
    	at com.sunopsis.dwg.cmd.g.y(Unknown Source)
    	at com.sunopsis.dwg.cmd.e****n(Unknown Source)
    	at java.lang.Thread****n(Thread.java:534)
    After i check data in all_indexes table, i have found some old data which are belongs to 2008 and 2009. The sample as below:-
    Code:
    OWNER     INDEX_NAME          LAST_ANALYZED
    SDS1	PK_ACTION	   31-OCT-09 07:04:49
    SDS1	AK_ACTION	   31-OCT-09 07:04:49
    SDS1	PK_COND	                31-OCT-09 07:04:50
    SDS1	AK_COND	                31-OCT-09 07:04:50
    SDS1	COND_FK1	   31-OCT-09 07:04:50
    SDS1	COND_FK2	   31-OCT-09 07:04:50
    is it the problem due to the old data not remove from the all_indexes table ?.. if YES is it I have to delete the old data manually from the all_indexes table ?

    Please guide me ?

    Thank you
    baharin

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    All_INDEXES is an oracle table that lists all the indexes are you may NOT delete from it. Remove the indexes and they will leave the view.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    If you do not need the existing rows(that you call old data) in the table, just remove them:
    Code:
    delete from table_name where column_name = 'some_key';
    or you can use the merge statement to insert / update or delete
    rows in the table:
    ORACLE-BASE - MERGE Statement Enhancements in Oracle Database 10g

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •