Unique constraint error but key when inserting unique keys!

Hi,
I am tring to update an existing database with some older data, I am getting an error which complains about a unique constraint being violated although there is no voilation evident after testing.
I am puzzled by this and was wondering if someone could give me any extra info on another possible cause.
I googled but found that this error is caused by duplicating primary keys which I am not doing though I still get this error.
I run this query then the update and get the output below:
desc test_sales;
desc sales_order;
SELECT order_id FROM sales_order WHERE order_id IN (SELECT order_id FROM test_Sales);
INSERT INTO sales_order
(order_id,order_date,customer_id, ship_date,total)
SELECT 
      order_id,
      order_date,
      cust_id,
      ship_date,
      total
FROM
      test_sales;
desc test_sales;
Name                           Null     Type                                                                                                                                                                                         
------------------------------ -------- CUST_ID                                 NUMBER(6)                                                                                                                                                                                    
OLD_SYSTEM_ID                           VARCHAR2(25)                                                                                                                                                                                 
DESCRIPTION                             VARCHAR2(35)                                                                                                                                                                                 
ORDER_DATE                              DATE                                                                                                                                                                                         
SHIP_DATE                               DATE                                                                                                                                                                                         
QUANTITY                                NUMBER                                                                                                                                                                                       
ORDER_ID                       NOT NULL NUMBER(4)                                                                                                                                                                                    
ITEM_ID                        NOT NULL NUMBER(4)                                                                                                                                                                                    
SITE_COUNT                              NUMBER(2)                                                                                                                                                                                    
TOTAL                                   NUMBER(8,2)                                                                                                                                                                                  
PRODUCT_CODE                            NUMBER(6)                                                                                                                                                                                    
LIST_PRICE                              NUMBER(8,2)                                                                                                                                                                                  
12 rows selected
desc sales_order;
Name                           Null     Type                                                                                                                                                                                         
------------------------------ -------- ORDER_ID                       NOT NULL NUMBER(4)                                                                                                                                                                                    
ORDER_DATE                              DATE                                                                                                                                                                                         
CUSTOMER_ID                             NUMBER(6)                                                                                                                                                                                    
SHIP_DATE                               DATE                                                                                                                                                                                         
TOTAL                                   NUMBER(8,2)                                                                                                                                                                                  
5 rows selected
ORDER_ID              
0 rows selected
Error starting at line 7 in command:
INSERT INTO sales_order
(order_id,order_date,customer_id, ship_date,total)
SELECT 
      order_id,
      order_date,
      cust_id,
      ship_date,
      total
FROM
      test_sales
Error report:
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00001: unique constraint (MICHAELKELLY.SYS_C00210356) violatedMessage was edited by:
Mike1981
Message was edited by:
Mike1981

ORA-00001: unique constraint (MICHAELKELLY.SYS_C00210356) violated
=> check dba_cons_columns to see what the constraint actually exists off

Similar Messages

  • Get ORA-01031: insufficient privileges error, but only when using dbstart.

    I am getting ORA-01031: insufficient privileges error, but only when using dbstart. the listener starts but not the database. How come I can start it from SQL prompt but not from dbstart scripts as the oracle user?
    [oracle@mallard bin]$ ./dbstart
    Processing Database instance "gf44": log file /prod/oracle/10/startup.log
    [oracle@mallard bin]$
    Log file:
    Wed Aug 20 10:15:02 CDT 2008
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 20 10:15:02 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> ERROR:
    ORA-01031: insufficient privileges
    SQL> ORA-01031: insufficient privileges
    SQL>
    /prod/oracle/10/bin/dbstart: Database instance "gf44" warm started.
    >
    oratab file:
    gf44:/prod/oracle/10:Y
    dbstart file section:
    # See if it is a V6 or V7 database
    VERSION=undef
    if [ -f $ORACLE_HOME/bin/sqldba ] ; then
    SQLDBA=svrmgrl
    VERSION=`$ORACLE_HOME/bin/sqldba command=exit | awk '
    /SQL\*DBA: (Release|Version)/ {split($3, V, ".") ;
          print V[1]}'`
    case $VERSION in
    "6") ;;
    *) VERSION="internal" ;;
    esac
    else
    if [ -f $ORACLE_HOME/bin/svrmgrl ] ; then
    SQLDBA=svrmgrl
    VERSION="internal"
    else
    SQLDBA="sqlplus /nolog"
    fi
    fi
    Permissions of file:
    [oracle@mallard bin]$ ls -la dbstart
    -rwxrwxr-x 1 oracle oinstall 10407 Aug 19 12:27 dbstart
    [oracle@mallard bin]$
    User permissions:
    [root@mallard 10]# id oracle
    uid=503(oracle) gid=503(oinstall) groups=503(oinstall),504(dba)
    [root@mallard 10]#
    I can start the listener manually using "./lsnrctl start" and start the database manually from sql prompt using "SQL>startup" (as sysdba) with no problems. this only happens when using dbstart file. I am logged in as oracle user and all environment variables are set
    Thank you for any help you could provide.

    I have the same problem, but i don't want insert this string
    Connect sys/{password} as sysdbaI have deployed an Oracle 10g with os SunOS
    $ uname -a
    SunOS DB02 5.10 Generic_141444-09 sun4v sparc SUNW,Sun-Blade-T6320
    I can connect with sys/password, but I can't login with
    $ sqlplus /nolog
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 7 15:19:50 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> connect / as sysdba
    ERROR:
    ORA-01031: insufficient privilegesthe the startup and dbshut don't work.
    Someone maybe help me?
    Thanks,
    Regards.
    Lain

  • Fragment works standalone but not when inserted in a form

    I have a search fragment. When I open the fragment and click "Preview" in designer. I click on the "search" button, and it executes a web service that retrieves info from a database and displays it into a table. Everything is working beautifully. The fragment is set to Interactive, and Dynamic XML form.
    I now create a new form and I insert this search fragment into the form. This form is also set to Interactive, and Dynamic XML form. Now, when I click on the "search" button, all of the javascript behind the button executes (i.e. my messageBox debugging messages) but the web service that retrieves the database info doesn't seem to execute.
    What am I missing? I'm perplexed as to why the fragment works stand-alone but doesn't want to work when incorporated into a parent form.
    Any ideas?

    Nope, no errors in the java debugger console.
    The fragment is an xdp (Adobe XML Form) - with form properties "Interactive Form" and "Dynamic XML Form"
    The "parent" form that contains the fragment is an xdp with the exact same form properties as the fragment.
    Here's what's in the debugger console, just general info:
    Acrobat JavaScript Debugger Functions Version 7.0
    Acrobat Database Connectivity Built-in Functions Version 8.0
    Acrobat EScript Built-in Functions Version 8.0
    Acrobat Annotations / Collaboration Built-in Functions Version 8.0
    Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0
    Acrobat Multimedia Version 8.0
    Acrobat SOAP 8.0
    Anything else I can check?
    --Elaine

  • Oracle Error Ora-27069 when inserting bulk data

    Hi,
    I'm inserting 10.5 million rows in a table using insert statement, & system is giving below error:
    Code -1114, Description - ORA-01114: IO error writing block to file 201 (block # 74633)
    ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
    OSD-04026: Invalid parameter passed. (OS 74639)
    ORA-01114: IO error writing block to file 201 (block # 74633)
    ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
    OSD-04026: Invalid parameter passed. (OS 74639)
    Please suggest the action for this error
    Thanks
    Deepak

    ...I apologize but of course setting the size to 3.8GB max is a "non-sense". The major thing is not to hit the 4GB size from a tablespace in Autoextend. So setting the initial size of the datafile to a value superior to 4GB is enough then you can be in Autoextend.
    Then you'll eventually hit the maximum size in number of blocks for a datafile but this is easily solved by adding a new datafile.
    Regards,
    Guillaume.

  • ECC / Parity errors but 'only' when running qmaster / Compressor ?!!

    I have a Mac Pro that came with 4GB of (Apple) Ram. I recently installed 4 addiitonal (to fill both risers to 8GB total), of branded, supposedly apple-certified Ram from one of the major vendors we all have come to love and trust.
    Anyway, all seems fine - but now I am running QMASTER/Compressor which in fact wires (or at least pages) so much ram as to make good use of my 8: I have only 80MB free- but hey that's good, the memory is being used.
    Here's the odd thing, when doing compressor / qmaster tasks (this is both the cluster server and a service node) I now get ECC Parity errors:
    - Of my 8 chips, 3 have trown ECC Parity errors (all corrected), ranging from 1 on one chip to now 35 on another. This is in a 24h period
    - THis is on the APPLE ORIGINAL RAM - none of the 'new' chips have any errors ?!!!
    - Errors show up in 'about system' as well as the console log- but I ran EXTENDED Hardware test twice - and both times the memory (whole system) comes up clean!
    - ECC errors don't show up - as far as I can tell, if I don't 'extremely' tax the system - i.e. running email, Safari, iTunes and, maybe WoW keep it 'clean'! but also leave between 3-6GB memory 'free'
    - The errors occur on 2 seperate risers
    So, here's my dilemman - I can replicate this everytime i use compressor/qmaster. However, I never (yet) had a related crash or issues.
    It started with 'just' one chip, now it's 3 - again, all the original apple ram.
    My memory is installed correctly (i.e. both apple pairs together and both OWC together).
    I would LOVE to get some suggestions. Logic would say this is related to the new memory BUT I also never ran a compressor/qmaster renderfarm before now. I already opened a case with Apple and they are sending me one new chip (I opened at the time only one chip was having the errors).
    So - normal? Low enough at high volume I shouldn't worry? Routine with compressor and qmaster Or time to panic?
    THANKS!
    Dan

    This is very interesting. We, too, recently experienced a hard RAM Parity Panic/Crash on a Qmaster/Compressor encoder node. About two weeks earlier, we experienced a RAM Parity Panic/Crash on a system that has nothing to do with Qmaster.
    Both machines are dual G5 Xserves with factory-installed RAM. The encoder had six 512MB sticks while the non-encoder server had 2 1MB sticks.
    The encoder died, but when rebooted kept working by ignoring the bad RAM and working off only 2GB of the good RAM (must be in pairs).
    Apple replaced both sticks under warranty.
    As for Qmaster/Compressor causing the errors, I have no insight. If that were the case, I assume we'd see this on most if not all our encoders and cluster controllers. And that hasn't happened.
    I'd say, you got bad RAM and it needs to be fixed.
    The panic.log should give you insight into which dimm slot threw the error.
    Good luck!

  • Error: cannot commit (when inserting the row)

    hai,
    I create the trigger like below.
    create or replace trigger proce
    after insert on samp3
    declare
    ass date;
    begin
    select d into ass from samp3;
    updatecourse(ass);
    end;
    when I try to insert the row then the error is come;
    ERROR at line 1:
    ORA-20001: An error was encountered - -4092 -ERROR- ORA-04092: cannot COMMIT in a trigger
    ORA-06512: at "AUROLIVE.UPDATECOURSE", line 22
    ORA-06512: at "AUROLIVE.PROCE", line 5
    ORA-04088: error during execution of trigger 'AUROLIVE.PROCE'
    can any one help me?
    Regards,
    Ramya.S

    If u want to put commit on trigger use pragma
    autonomous_transaction.what it does,it leave the main
    transaction and commit the second transaction.Which can lead to logic problems and corruption of your business data if not used extremely carefully.
    If you start transaction 1 and during that write some other data as transaction 2 using autonomous transactions and then subsequently find that there is an error or some reason not to commit transaction 1 then you cannot automatically roll back transaction 2 and would have to take care of it manually.
    I see too many occurences of developers using autonomous transaction all over the place just because they want to get the data written to the database and then they're wondering why there is so much clutter in their data and the database integrity is poor from a business/logical point of view. The first thing any good design includes is a knowledge of the business transactions and when data should be committed and what the implications of using autonomous transactions are.

  • 2010 EWS 2.0 C# Windows 7: "Data is Corrupt" error, but only when forwarding messages from a certain user

    I have an application that is basically a mailing list manager. New messages are sent to an Exchange mailbox, from outside of our organization. Periodically the application runs, scans the mailbox for new messages, and forwards them to the appropriate users.
    For the most part this works fine, but messages that come from a specific outside user cause a "Data is Corrupt" message.
    I have tried re-creating the messages that cause problems, both using Outlook and using a Gmail account. In both instances, the message went through the system with no problems. But this vendor is doing something that is causing me grief.
    I've included some sample code below. What I would really like are tips for debugging these kinds of problems. It seems to me that "Data is Corrupt" is sort of a generic error.
    private void ForwardMessage(EmailMessage msg, List<String> recipients, String replyTo)
         ResponseMessage stepOne;
         EmailMessage stepTwo;
         Folder drafts;
         ConversationId cid;
          * This is a little screwy.
          * EmailMessage.CreateForward() is really useful, because it preserves
          * attachments. But it mangles the message body and subject, so I have reset those.
          * And it doesn't support setting the Reply To, so I have to do this
          * in two steps: create the forward, save to Drafts, then get the
          * message in the Drafts forward, and set the Reply To.
         cid = msg.ConversationId;
         stepOne = msg.CreateForward();
         stepOne.Body = msg.Body;
         stepOne.Subject = msg.Subject;
         foreach (String s in recipients)
              stepOne.BccRecipients.Add(s);
         stepOne.Save(WellKnownFolderName.Drafts);
          * There is a chance, though small, that another process
          * could create a draft message in response to the message
          * I'm in the process of forwarding. But it is unlikely,
          * so I'm going to live with this. Extended Properties would
          * be the safer way to do this, but I couldn't get them
          * to make the trip.
         stepTwo = null;
         drafts = Folder.Bind(msg.Service, WellKnownFolderName.Drafts);
         foreach (EmailMessage em in drafts.FindItems(new ItemView(100)))
              if (em.ConversationId.Equals(cid))
                   stepTwo = em;
         if (stepTwo != null)
              stepTwo.ReplyTo.Add(replyTo);
              // This next line is where the "Data is Corrupt" error keeps happening
              stepTwo.SendAndSaveCopy();

    The place to start with Debugging would be to enable tracing and look at requests and responses your getting from the server to see if there is additional information and to also know which operation is failing see 
    http://msdn.microsoft.com/en-us/library/office/dd633676(v=exchg.80).aspx
    You might also want to do some testing with the EWSEditor
    http://ewseditor.codeplex.com/
    There also should be an EWSLog on the CAS server where the requests are being sent so this is worth looking at as well eg \Microsoft\Exchange Server\V14\Logging\Ews
    As a workaround with the failed messages you might want to trying getting the MimeContent and forwarding that instead of using the Forward operation
    Cheers
    Glen

  • Error code OX80010108 when inserting cd to display photos.

    Have uninstalled Windows live photo gallery and reinstalled but still happening!

    lizzieoreilly wrote:
    Have uninstalled Windows live photo gallery and reinstalled but still happening!

  • Help with unique constraint ERROR!!!

    This error occurs after invoking a Stored Procedure program. When it tries to insert, the PK table goes beserk:
    ORA-00001: unique constraint (HASUNI.THA_OTHER_ACTIVITY_PK) violated
    ORA-06512: at "HASUNI.POPULATE_GDW_ACTIVITY", line 203
    ORA-06512: at "HASUNI.GDW_MASTER", line 21
    ORA-06512: at line 9
    I tried to clear the PK table to get past the unique constraint error, but I can't seem to delete contents.
    PLEASE HELP!!!!

    The other queries are erroring out. It doesn't like the HASUNI.THA_OTHER_ACTIVITY_PK. It says this is an undefined table.
    Insert Statement:
    INSERT INTO HASUNI.THA_OTHER_ACTIVITY <-- line 203
    SELECT
    viewActivity.GROUPID,
    SUBSTR(viewActivity.MEMBERID,11,9)||SUBSTR(viewActivity.MEMBERID,21,9),
    viewActivity.ACTIVITYSEQUENCE,
    val_first_day,
    TO_DATE('31DEC9999'),
    viewActivity.PRODUCTID,
    viewActivity.PRODPLANTYPE,
    SUBSTR(viewActivity.MEMBERID,11,9),
    SUBSTR(viewActivity.MEMBERID,21,9),
    viewActivity.CLASSVAL,
    viewActivity.PCC,
    viewActivity.BRANCH,
    viewActivity.ARC,
    viewActivity.LOCATION,
    viewActivity.MEMBERID,
    viewActivity.DOB,
    viewActivity.GENDER,
    viewActivity.MEMBERSTATUS,
    viewActivity.CHPNID,
    viewActivity.SSN,
    NULL,
    NULL,
    SUBSTR(viewActivity.ZIPCODE,1,5),
    SUBSTR(viewActivity.ZIPCODE,7,4),
    viewActivity.ST,
    viewActivity.SOURCESYSTEMID,
    viewActivity.SOURCE,
    viewActivity.INITIATEDBY,
    viewActivity.OUTCOMES,
    viewActivity.OUTCOMESDATE,
    viewActivity.INITACTDATE,
    viewActivity.INITACTTAKEN,
    viewActivity.INITACTTAKENDATE,
    viewActivity.INITUSERID,
    viewActivity.LASTMODUSRID,
    viewActivity.LASTMODDATE,
    'HAS',
    val_last_day,
    NULL
    FROM
    HASUNI.VW_GDW_ACTIVITY viewActivity,
    HASUNI.HA_OUTREACH outreach
    WHERE
    viewActivity.MEMBERID IN (SELECT viewActivity.MEMBERID FROM HASUNI.VW_GDW_ACTIVITY viewActivity)
    AND outreach.MMBR_ID = viewActivity.MEMBERID
    AND viewActivity.INITACTTAKEN = 'OTHER'
    AND (TRUNC(viewActivity.INITACTDATE) BETWEEN val_first_day AND val_last_day
    OR (TRUNC(viewActivity.INITACTDATE) < val_first_day
    AND TRUNC(viewActivity.LASTMODDATE) BETWEEN val_first_day AND val_last_day));

  • Unique constraint is not thrown when used MERGE INSERT (alone) via dblink.

    We found some interesting behaviour of unique constraint on Merge query when we use Merge When Not Matched Insert (no update query) via a dblink.
    In one Schema S1, on Table A1(c1,c2,c3) there is a unique constraint on column (c1,c2).
    Column c2 is nullable and has null for some records.
    Now i have a table A2 with same defintion as A1 in Schema S2.In S2 , i have a dblink of S1 as S1 itself.
    I have data in S2.A2. Here also i have some records with c2 as null and c1 matching with the data of S1.A1.
    Now from schema S2,
    I am using the following Merge Query,
    MERGE INTO S1.A1 target
    USING S2.A2 source
    ON (target.c1 = source.c1 and target.c2 = source.c2)
    WHEN NOT MATCHED
    INSERT (c1,c2,c3) values (source.c1, source.c2,source.c3)
    WHEN MATCHED
    UPDATE c3 = source.c3;
    Now when i execute this merge in schema S2,
    if i have some data in S1.A1 and S2.A2 having c1 as same and c2 as null, as oracle does not treat two nulls same, it goes for an insert, i have got unique constraint violated error.
    But if i execute MERGE INSERT alone, though that record is getting inserted , i am not getting unique constraint violated error.
    Oracle version we are using is 10g (10.2...).
    Is it a bug in oracle or what could have caused this behaviour.

    Dear,
    ERROR at line 1:
    ORA-00001: unique constraint (SYS_C00137508) violatedYou need to think about two things
    (a) read consistency : what was the situation of table_1 when the maching clause has been initially evaluated ; there were 0 rows matching which means the merge operation will be all insert
    (b) your matching clause has a problem : the join column must be unique in both tables otherwise the merge will be ambigous. You don't have a unique key on the source table
    (c) think that the merge operation will never insert id =1 and then update id = 1 within the same operation. This will never happen
    Hope this helps
    Mohamed Houri

  • PK with TIMESTAMP causes insert unique constraint error at DST switch

    Hi,
    I have a test that inserts rows in a table that has a TIMESTAMP in its PK.
    When inserting rows that cross over the November DST change, it tries to insert these dates:
    --- Sun Nov 02 02:00:00 EST 2008
    --- Sun Nov 02 01:00:00 EST 2008
    --- Sun Nov 02 01:00:00 EDT 2008
    This is the output of 3 different UTC dates. We can see that there are 2 x 1am, but they differ in their DST. They are really 3 different UTC dates.
    But I get this error:
    --- Expected error: ORA-00001: unique constraint (DDLTEST1.SYS_C00142622) violated
    But I can get around that error and can insert these same dates if I set my JVM to UTC. The inserts work so I suspect this to be a JDBC issue.
    I am using the Oracle Thin driver in a spring app:
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
    <property name="url" value="jdbc:oracle:thin:@localhost:db" />
    I can post the sample code but wonder if there is an obvious answer to this.
    Note that MySql had the same problem. I fixed it by specifying the UTC timezone in the connection string, like this:
    jdbc:mysql://[host]/[db]?useLegacyDatetimeCode=false&useTimezone=true&sessionVariables=time_zone='UTC'
    Any idea how to get around that problem without setting JVM to UTC ?
    Claude
    Edited by: user2678899 on 10 juin 2009 10:09
    I removed #2 work around which was wrong
    Edited by: user2678899 on 10 juin 2009 10:23

    Timur Akhmadeev wrote:
    Hi,
    I suspect this to be a JDBC issue.Nope, this is your schema design gap. It breaks the main principle of PK: to uniquely identify a row in a table always. Your PK doesn't satisfy it, since it depends on client's settings.Why is setting the JVM to UTC working ? This is the part that confuses me.
    I create the 3 dates in Eastern time, then change the JVM default to UTC: the 3 inserts work.
    I create the 3 dates in Eastern time, then leave the JVM to Eastern time , the 3rd insert gets the unique constraint error.
    To me, the PK principle is not broken: these are 3 different UTC dates.

  • Unique constraint error on delete/insert

    Hi,
    I am using Jdeveloper 11.1.1.3.0. I have a ADF table where we can copy lines and delete lines. I get unique constraint error when I save. Looks like the insert operation in happening before the delete operation. Is there a way to set the execution order so that the logical behaviour is delete/update/insert.
    Thanks
    SV

    Hi,
    The unquie contraint is not from the primary key. There are three columns in the table (batch_id, line_number, line_type) which must be unique. In the UI, the user can delete lines, update lines and add lines and finally click the save button that does the commit. On delete the line_number gets re-numbered. So when committing, the unique error occurs because the line number already exists. Looks like insert is happening before update/delete. I cannot do commit after each delete/update/insert. I have to do it only if the user clicks the save button in the end. Is there a way to control the order of execution?
    SR

  • Sybase Error 2601 Attempt to insert duplicate key row in object with unique

    RE: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
    Hi Folks,
    I'm getting the following error whilst executing a stored procedure in Sybase.
    ERROR: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
    I understand that duplicate values have been inserted into a column that has a unique constraint.
    I just can't figure out how to rectify the problem.
    Your help will be greatly appreciated!
    Many thanks in advance.

    If the value I'm trying to insert (using update)
    already exists in the unique-value field then the DB
    refuses to update the field.
    If the value is different it will update.Are you trying to insert or update in SQL (identified by the keyword INSERT or UPDATE respectively)?
    Even in case of an UPDATE query, if you are going to update the values of some columns to violate the unique constraints, the update will not succeed and you will get the error message.
    or is it?
    it tries to create a new row, but can't because there
    is another row with the same unique-values.
    If this is the case, I am only trying to update and
    not create a new item.To put it in simpler words, if you have a set of values defining the uniqueness of a record, you cannot insert another record with the same set of unique values. Similarly, you cannot update an existing record by modifying the set to conflict with another set of unique values which already exist in the database.
    Suppose there are two columns A and B defining the uniqueness of the record and you have only two records at the moment like -
    A B
    ========
    1 1
    2 1
    If you try to insert a record with A = 1 and B = 1, it will fail because a record already exists. You cannot violate uniqueness because the database has already been told that there will be only one record for any given combination of A and B.
    Similarly, if you try to update the second record from A = 2 to A = 1, the end result would be A =1 and B = 1. There is already a record with that set of values and this will result in a violation of the uniqueness. So, this update will also be disallowed. On the other hand, if you try to update B to some value, say 3, there is no problem in doing so.
    For convenience, you can imagine an UPDATE operation to be equivalent to DELETE + INSERT operation, though it doesn't necessarily work the same way internally.
    I hope I was clear enough.

  • ORA-00001: unique constraint error..

    Hi There,
    We were trying to do an insert when we started having ORA-00001: unique constraint error.. to speed our testing we decided to disable all the constraints on the table; however we still having the same issue.
    How can we resolve this please.
    SQL> select constraint_name,constraint_type,status from dba_constraints where table_name='MEMBER_LATEST';
    CONSTRAINT_NAME                C STATUS
    MEMBER_LATEST_PK               P DISABLED
    SYS_C0017577                   C DISABLED
    SYS_C0017576                   C DISABLED
    SYS_C0017575                   C DISABLED
    SYS_C0017574                   C DISABLED
    SYS_C0017573                   C DISABLED
    SYS_C0017572                   C DISABLED
    SYS_C0017571                   C DISABLED
    SYS_C0017570                   C DISABLED
    MEMBER_LATEST_FK               R DISABLED
    10 rows selected.
    SQL>
    SQL>
    SQL>     INSERT INTO MEMBER_LATEST (DIS_ID, TIMESTAMP, LAST_NAME, FIRST_NAME, MIDDLE_NAME, DIS_COUNT)
      2    SELECT DIS_ID, 'TEST', LAST_NAME, FIRST_NAME, MIDDLE_NAME, 0
      3    FROM MV_DIS_MEM, MV_DIS_COUNT
      4    WHERE MV_DIS_MEM.P_CODE =  MV_DIS_COUNT.P_CODE
      5    ORDER BY 1,3,4;
        INSERT INTO MEMSCH.MEMBER_LATEST (DIS_ID, TIMESTAMP, LAST_NAME, FIRST_NAME,
    ERROR at line 1:
    ORA-00001: unique constraint (MEMSCH.MEMBER_LATEST_PK) violated
    SQL>Anything else we can do please?
    Thanks

    rsar001 wrote:
    but isn't the unique index constraint part of the disabled constraints on the table as shown above?Not if index used by PK was created separately prior to PK:
    SQL> create table emp1 as select * from emp;
    Table created.
    SQL> alter table emp1
      2  add constraint emp1_pk
      3  primary key(empno);
    Table altered.
    SQL> insert into emp1 select * from emp;
    insert into emp1 select * from emp
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.EMP1_PK) violated
    SQL> alter table emp1 disable primary key;
    Table altered.
    SQL> insert into emp1 select * from emp;
    14 rows created.
    SQL> rollback;
    Rollback complete.
    SQL> alter table emp1 drop primary key;
    Table altered.
    SQL> create unique index emp1_pk on emp1(empno);
    Index created.
    SQL> alter table emp1
      2  add constraint emp1_pk
      3  primary key(empno)
      4  using index emp1_pk;
    Table altered.
    SQL> insert into emp1 select * from emp;
    insert into emp1 select * from emp
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.EMP1_PK) violated
    SQL> alter table emp1 disable primary key;
    Table altered.
    SQL> insert into emp1 select * from emp;
    insert into emp1 select * from emp
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.EMP1_PK) violated
    SQL> But by dropping index you are simply delaying the issue. Yes, you will be able to insert, but what's then? You will not be able to recreate PK - same violation error will be raised.
    SY.

  • Unique Constraint Error at Apply side

    We have streams configured between two databases. Source database is of Version 9.2.0.3 and target database is of 9.2.0.4
    I have a table TEST with primary key PK_TEST on column A.
    Performed the following steps on the source database:
    Step1:
    insert into test values (1);
    1 row inserted.
    Total no of lcr's propagated : 1
    Step2:
    insert into test values (1);
    ORA-00001: unique constraint (TEST_USER.PK_TEST)violated.
    Total no of lcr's propagated : 1
    Step 3:
    Commit;
    Total no of lcr's propagated : 1
    On the source database, i have only one row in the TEST table but in the target schema iam getting "ORA-00001: unique constraint" error on applying the lcr's propagated from the source. If i remove the constraint from the target table then two rows are getting inserted in the target table rather only one rows should be inserted in the target table.
    Total 3 lcr's are propagated from source to target. For Step2, 2 lcr's should be propagated but only one is propagating.
    It looks strange but this is what happening in our environment. Has anyone faced this problem before? Please let me know how to solve this problem.

    Hi,
    I believe your problem is with the transaction.
    1) First you insert a row
    2) you try to insert it again, it fails
    3) you commit your work
    When propagated to your destination, the transaction does not commit because it failed in the second.
    Try inserting, commit and inserting again. It should work that way. Or else you may need to write an error handler to ignore ORA-0001 errors and commit (which I don't think it is good practice).
    Hope this helps,

Maybe you are looking for

  • HELP: iPhoto not responding upon login for weeks!!!!

    Hi, I am in need of help. My iPhoto will not open when I open the application. All I get it Application not responding when I right click on the app sign and the spinnning wheel when I go on iPhoto. It's just froze. I have tried launching iphoto whil

  • Apple outlook DAV config

    Apple outlook DAV config has stopped working it used to work ok and was very useful - any ideas ?

  • Recovery problem on m30

    Hi . When i use my recovery cd , the message "Wrong machine " appear. but my recovery cd is original and it was work before. and i can't install anything in my machine , the message "error to open cab" is appeare on all software. Can any one help me

  • Error when accessing service fcom_ip_proj_overall01

    Hi all, When executing a search in Overall Planning using NWBC a 500 SAP Internal Server Error is returned "termination: RABAX_STATE". The error from the dev_icf log file is below and a screen shot of the dump in ST22 is attached. I have attempted to

  • Lifetime Support Dates

    Hi, Could you please tell me what is the lifetime support dates (Premier Support, Extended Support, Sustaining Support Ends) for JDeveloper 11g. Thanks.