Error logging on primary key

Hello,
Here is the context :
- The DB (10.2) is in production. I can not disable/drop/alter constraints
- I have to reinject thousands of rows from another DB through database link but some of thoses lines may be rejected by the primary key / unique key in the production DB
- As the row number is very large, I do not want to do the following :
<pre>insert into t_prod ( ...)
select ... from t_remote@db_link
where ...
and .. not in (select ... from t_prod where ..)</pre> ;)
As the constraints are UK/PK, I can not use the error logging in insert statement
As the constraints must be kept enabled, I can not use the exceptions into in an alter constraint statement
Is there any way to avoid the infamous not in select ?
Thanks,
Christian.

I prefere to use the SQL documentation over the Admin Manual (very personal preference). http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB
Often it is more clear. In this case:
REJECT LIMIT
This clause lets you specify an integer as an upper limit for the number of errors to be logged before the statement terminates and rolls back any changes made by the statement. The default rejection limit is zero. For parallel DML operations, the reject limit is applied to each parallel server.
A reject limit of 0 would be mean, zero errors are logged before the statement terminates and rolls back.
I agree that this is the same as "no error logging". Good thing you pointed this out, I was not aware of it myself.

Similar Messages

  • Error: has no primary key specified. It should define either an @Id, @Embed

    I'm using toplink with JPA. it was able to deploy to OC4J succesfully. however, when I deploy to oracle application server 10.1.3, I got the following error:
    has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass.
    I do have @Id defined for id property. I tried to move @Id annotation to getId() method, instead of id property, the deployment succesfully.
    I have many entities need to be changed. i'm wndoring if there is configuration or if it is bug of OAS 10.1.3

    Hello,
    You haven't mentioned which version of OC4J you are successfully deploying to. If it is not 10.1.3, then you might try upgrading your OAS server so that its version matches the OC4J version you are using. OAS 10.1.3 only had very limited JPA support, and so it is advisable to use OAS 10.1.3.3 anyway.
    Best regards,
    Chris

  • Error in dropping primary key constraint after import.

    hi all,
    i am getting the following probelm can some one help me
    Usually if we drop the primary constarint the index created on the primary key will also be drop automatically.when i do export and import of particular schema and after the import if i drop the primary key constraint , the index created on the primary key is still existing .
    i am using the oracle 10g database and export and import utility.
    i am facing this problem on windows 2003 server
    can some one help what was going wrong.
    thank you in advance.
    kalyan

    if you dont want the constraint and index then control it in the import itself.
    eg:- imp constraints=n indexes=n
    regds,
    Thomas.

  • Error in sharepoint external list while creating record with same id (this id is primary key)

    Hi,
    I have created one external content type in sharepoint designer to insert/update/delete table data.
    This table contains Primary key constraint.
    Then I have added this external content type to Sharepoint out of box List.
    Insert/Update/Delete is working fine. But when I am trying to insert record with the same id which is already exist in table, page crashed and its giving me following error:
    “Violation of PRIMARY KEY constraint 'PK_tbl_Accounts'. Cannot insert duplicate key in object 'dbo.tbl_Accounts'.
    The duplicate key value is (1). The statement has been terminated.”
    So I want to handle this exception. Can we show any popup message to hide this error?
    Thanks & Regards
    Rajni

    Avoid entering of primary from form  if possible.
    if not try to customize the new form with infopath and place your custom logic there.
    http://lightningtools.com/uncategorized/modifying-external-list-forms-with-infopath-2010/
    http://salnikan.wordpress.com/2011/07/26/prevention-of-duplicate-entries-based-on-two-or-more-columns-in-a-sharepoint-list/
    Bala

  • IDOC to MSsql,  error in mapping(Violation of PRIMARY KEY constraint)

    Hi All,
    I'm working with MATMAS IDOC  to MSSql. My SQL structure is of 8 tables(multiple statements) with primary key. In mapping i have used UPDATE_INSERT in action field for all the tables but still im getting "Violation of PRIMARY KEY constraint" for the last table structure. first 7 tables are single occurances but the 8th structure data is coming multple times from IDOC(E1MARMM).
    my 8th table structure is :
    STATEMENT8                                IDOC(MAPPED)
    TABLE8
    ACTION                                      UPDATE_INSERT
    TABLE                                           TABLENAME
    ACCESS     0 to Unbounded            MAPPED with E1MARMM
    Item_CD                                used oneasmany +splitbyvalue with MATNR
    Plant_ID                                  used oneasmany +splitbyvalue with WERKS  
    EAN_CAT                                 used oneasmany +splitbyvalue with NUMTP
    EAN                                             used oneasmany +splitbyvalue with EAN11
    Numerator_For_Conversion_To_BaseUOM
    Display_UOM
    Denominator_for_conversion_To_baseUOM
    KEY           0 to Unbounded                 MAPPED with E1MARMM
    Item_CD                                used oneasmany +splitbyvalue with MATNR
    Plant_ID                                  used oneasmany +splitbyvalue with WERKS  
    EAN_CAT                                 used oneasmany +splitbyvalue with NUMTP
    EAN                                             used oneasmany +splitbyvalue with EAN11
    Display_UOM
    in test tab its fine and fetching number of times according to MARMM segments  but in END to END testing its triggering an error stating that
    ""Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'MM_EAN' (structure 'STATEMENT8'): com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK_MM_EAN'. Cannot insert duplicate key in object 'dbo.MM_EAN'.  ""
    Plz help me regarding this..

    Hi team,
    How resolve the below error 
    Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?
    Thanks,
    Ram
    RAM
    There can be two reasons
    1. The insert script used is having multiple instances of the records with Key as 12610 returned from the source query. If this is the issue add a logic to include only the unique set of id values for records by avoiding duplicates. There are several approaches
    for this like using ROW_NUMBER with PARTITION BY, using a join with derived table etc
    2. The record with Key 12610 already exist in your destination table and your script is again trying to insert another instances of record with same key. This can be avoided by adding a NOT EXISTS condition with a subquery which will check and return only
    those records which doesnt already exist in the source
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Logging Primary Keys

    Hi
    I´m looking for a way to log the primary keys from many tables in a unique table and column.
    I thought to use xmltype column (like below) but I´m would like to hear another opinion about it.
    Record 1:
    '<TABLE>'
    ' <NAME>TB_ABC</NAME>'
    ' <PRIMARY_KEY>'
    ' <COLUMNX>XYZ</COLUMNX>'
    ' </PRIMARY_KEY>'
    '</TABLE>'
    Record 2:
    '<TABLE>'
    ' <NAME>TB_DEF</NAME>'
    ' <PRIMARY_KEY>'
    ' <COLUMNA>123</COLUMNA>'
    ' <COLUMNB>456</COLUMNB>'
    ' </PRIMARY_KEY>'
    '</TABLE>'
    Record ...
    Any problem to do that ? Performance risks ? Another better way ?
    Thanks in advance.
    Oracle 9iR2.

    Well, the goal is to log the changes made in some tables.
    Actually, in many tables there is a a trigger "Before update" to save the changes made (old/new values) and they are stored in a specific table that contains some columns as: Owner, Table_Name, Primary_Key ( columns separated by "+" delimiter in a varchar2 ), column_name, old_value, new_value, Date_Log ... ).
    That is a control, but I would like to change the way that the primary keys are kept.
    Based on that, I thought to replace the primary_key column to xmltype to facilitate the query and allow to use the xml functions.
    In my test it worked fine, I got to find the records in a simple query and become more flexible, look:
    Select Onwer, Table_Name, Column_Name, Old_Value, New_Value, Date_Log
    From Table_Log a
    Where a.Primary_Key.Extract('/TABLE/NAME/text()').getStringVal() = 'TB_ABC'
    and a.Primary_Key.Extract('/TABLE/PRIMARY_KEY/COLUMX/text()').getStringVal() = 'XYZ'
    Thanks in advance

  • Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?

    Hi team,
    How resolve the below error 
    Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?
    Thanks,
    Ram
    RAM

    Hi team,
    How resolve the below error 
    Violation of PRIMARY KEY constraint 'PK_test'. Cannot insert duplicate key in object 'dbo.test'. The duplicate key value is (12610). (Source: MSSQLServer, Error number: 2627) ?
    Thanks,
    Ram
    RAM
    There can be two reasons
    1. The insert script used is having multiple instances of the records with Key as 12610 returned from the source query. If this is the issue add a logic to include only the unique set of id values for records by avoiding duplicates. There are several approaches
    for this like using ROW_NUMBER with PARTITION BY, using a join with derived table etc
    2. The record with Key 12610 already exist in your destination table and your script is again trying to insert another instances of record with same key. This can be avoided by adding a NOT EXISTS condition with a subquery which will check and return only
    those records which doesnt already exist in the source
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Violation of PRIMARY KEY constraint during sending NCCode to system

    MES system is: (6.0.4.22)
    External software is sending NCData to MES system and sometimes gets error:"Violation of PRIMARY KEY constraint 'PK__BC_JMSQU__3F9FE7012CDE6A9D'. Cannot insert duplicate key in object 'SAPEL1DB.BC_JMSQUEUE'. The duplicate key value is (36, 26015261174081363, 3500000000000000001)"
    I provide client machine log with data details in file: "client device.txt"
    and default trace part in file: "default_trace.txt"

    Hi!
    You might be using NC Codes with Message Type assigned or you turned on RTW for NC. Please check if disabling these features makes any change.
    Also you can play with "Enable SFC Complete JMS Message" system rule.
    Regards,
    Sergiy

  • Violation of Primary Key after a successful Update of BP

    When I've updated a BP via VB.net is there something I should do with the BP object after I've done an update?
    I can't seem to do consecative updates or I get the following error:
    Violation of PRIMARY KEY constraint 'CRD1_PRIMARY'. Cannot insert duplicate key in object 'CRD1'
    This is the code I use for updating:
    For i = 0 To oBusinessPartner.Addresses.Count - 1
                oBusinessPartner.Addresses.SetCurrentLine(i)
                If (oBusinessPartner.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_ShipTo) Then
                    '** Check only SHIP TO Addresses
                    If (oBusinessPartner.Addresses.AddressName = cbSAPShipTo.SelectedItem) Then
                        '** Address User wishes to update
                        oBusinessPartner.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_ShipTo
                        oBusinessPartner.Addresses.AddressName = lSAPAddressItems(iIndex).Company
                        oBusinessPartner.Addresses.Street = lSAPAddressItems(iIndex).Address1
                        oBusinessPartner.Addresses.City = lSAPAddressItems(iIndex).City
                        oBusinessPartner.Addresses.ZipCode = lSAPAddressItems(iIndex).Postal
                        oBusinessPartner.Addresses.State = lSAPAddressItems(iIndex).Prov
                        oBusinessPartner.Addresses.Country = lSAPAddressItems(iIndex).Country
                    End If
                End If
            Next
            lRetCode = oBusinessPartner.Update()
    I check to make sure the address i want to up date is a ShipTo address, then I check to make sure that the item I am editing matches the one in the BPObject's CurrentLine.
    Then I just change the values and .Update() it
    After I've done this though, if I try to update another ShipTo address in the same BP, it comes up with that error.
    Should I kill the BP object and reinitialize it?

    Hi Tyler,
    I totally understand what you wanna do.
    The clauses which you use is trying to add a new address in the name of existing address.
    You have to do 'setcurrentline' clause, I guess.
    But now, you don't know 'what is the ShipTo line'.
    Then, I think you'd better use some simple, easy but timely expensive way.
    1. Count the records in CRD1 under conditions of the cardcode.
    -> then you can get the number of addresses of the business partner.
    2. use a loop (while, for.. doesn't matter.)
    -> Now you can use setcurrentline clause.
    3. If the addressname is 'ShipTo', then you can update the record, and exit loop.
    pseudo code comes below.
    sql = "Select count(*) FROM OCRD WHERE cardcode = 'aaa'"
    ors.doquery sql
    for i=1 to ors.fields.item(0)
    oBusinessPartners.Addresses.setcurrentline(i)
    if obusinessPartners.Addresses.AddressName = "ShipTo" then
    oBusinessPartners.block = "newBlock"
    exit for
    end if
    next i
    Hope this useful for you.
    Regards,
    Hyunil choi.

  • Primary Keys and ADT

    Hi,
    For uniformity sake, I've created a new data type with one property in it (VARCHAR2(30)). Prior to this I had that data type in all of my tables and created primary keys on that. Now, I have replaced the old VARCHAR2(30) with this new data type YET I want to keep my primary key on it. When I do this I get an error indicating a primary key can NOT be on a user defined data type.
    Am I missing something? Should I post code? Is this not possible?
    Any advice would be GREATLY appreciated.

    Steve,
    Primary key columns cannot be an object type.
    Regards,
    Geoff

  • Primary key = rowid???

    Hi all,
    I created a page from a SQL procedure.
    I call my page from another page, I have my data.
    Now I want to change the value in a field, but when I click “Save” I have an error.
    I open the debug and after the error I find:
    0.03803
    0.00061
    Session State: Save form items and p_arg_values
    4
    0.03865
    0.00032
    ...Session State: Save "P30_PK_DA_SUIVI_TEMPS" - saving same value: "81"
    4
    0.03898
    0.00091
    ...Session State: Save "P30_FK_ID_DA" - saving same value: "181"
    4
    0.03988
    0.00034
    ...Session State: Saved Item "P30_NUM_JJ_ESTIME" New Value="1"
    4
    0.04021
    0.00035
    ...Session State: Save "P30_NUM_JJ_REEL" - saving same value: "26"
    4
    0.04057
    0.00038
    ...Session State: Save "P30_NUM_JJ_ANALYSE_ESTIME" - saving same value: "0"
    4
    0.04094
    0.00036
    ...Session State: Save "P30_NUM_JJ_ANALYSE_REEL" - saving same value: "0"
    4
    0.04130
    0.00034
    ...Session State: Save "P30_NUM_JJ_DEVELOPPEMENT_ESTIM" - saving same value: "0"
    4
    0.04164
    0.00033
    ...Session State: Save "P30_NUM_JJ_DEVELOPPEMENT_REEL" - saving same value: "0"
    4
    0.04196
    0.00035
    ...Session State: Save "P30_NUM_JJ_TEST_ESTIME" - saving same value: "0"
    4
    0.04232
    0.00031
    ...Session State: Save "P30_NUM_JJ_TEST_REEL" - saving same value: "0"
    4
    0.04263
    0.00027
    ...Session State: Save "P30_NUM_JJ_DOCUMENTATION_ESTIM" - saving same value: "0"
    4
    0.04290
    0.00015
    ...Session State: Save "P30_NUM_JJ_DOCUMENTATION_REEL" - saving same value: "0"
    4
    0.04304
    0.00014
    Processes - point: ON_SUBMIT_BEFORE_COMPUTATION
    4
    0.04319
    0.00010
    Branch point: Before Computation
    4
    0.04328
    0.00005
    Process point: AFTER_SUBMIT
    4
    0.04333
    0.00041
    Tabs: Perform Branching for Tab Requests
    4
    0.04375
    0.00010
    Branch point: Before Validation
    4
    0.04385
    0.01056
    Validations:
    4
    0.05441
    0.00882
    Perform basic and predefined validations:
    4
    0.06323
    0.00042
    Perform custom validations:
    4
    0.06365
    0.00130
    ...Validation "P30_DAT_CREATION must be timestamp" - Type: ITEM_IS_TIMESTAMP
    4
    0.06495
    0.00029
    ...Validation "P30_DAT_MODIFICATION must be timestamp" - Type: ITEM_IS_TIMESTAMP
    4
    0.06524
    0.00007
    Branch point: Before Processing
    4
    0.06531
    0.00007
    Processes - point: AFTER_SUBMIT
    4
    0.06537
    0.00337
    ...Process "Process Row of TBL_DA_SUIVI_TEMPS" - Type: DML_PROCESS_ROW
    4
    0.06875
    0.00162
    ...Execute Statement: begin begin select into from "HORSES"."TBL_DA_SUIVI_TEMPS" where "PK_DA_SUIVI_TEMPS" = :p_rowid for update ; end; end;
    4
    0.07037
    0.00024
    Add error onto error stack
    4
    0.07062
    0.00010
    ...Error data:
    4
    0.07071
    0.00007
    ......message: ORA-06550: Ligne 1, colonne 22 : PL&#x2F;SQL: ORA-00936: expression absente ORA-06550: Ligne 1, colonne 14 : PL&#x2F;SQL: SQL Statement ignored
    4
    0.07077
    0.00005
    ......additional_info: ORA-06550: Ligne 1, colonne 22 : PL&#x2F;SQL: ORA-00936: expression absente ORA-06550: Ligne 1, colonne 14 : PL&#x2F;SQL: SQL Statement ignored
    4
    0.07082
    0.00004
    ......display_location: INLINE_IN_NOTIFICATION
    4
    0.07088
    0.00009
    ......is_internal_error: false
    4
    0.07096
    0.00008
    ......ora_sqlcode: -6550
    4
    0.07103
    0.00009
    ......ora_sqlerrm: ORA-06550: Ligne 1, colonne 22 : PL/SQL: ORA-00936: expression absente ORA-06550: Ligne 1, colonne 14 : PL/SQL: SQL Statement ignored
    4
    0.07112
    0.00007
    ......error_backtrace: ORA-06512: à "SYS.DBMS_SYS_SQL", ligne 1325 ORA-06512: à "SYS.WWV_DBMS_SQL", ligne 1022 ORA-06512: à "SYS.WWV_DBMS_SQL", ligne 1091 ORA-06512: à "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", ligne 832 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 552 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 725 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 871 ORA-06512: à "APEX_040200.WWV_FLOW_DML", ligne 1701 ORA-06512: à "APEX_040200.WWV_FLOW_PROCESS", ligne 364
    4
    0.07119
    0.00007
    ......component.type: APEX_APPLICATION_PAGE_PROCESS
    4
    0.07126
    0.00007
    ......component.id: 36252525824016323948
    4
    0.07134
    0.00053
    ......component.name: Process Row of TBL_DA_SUIVI_TEMPS
    4
    0.07187
    0.00024
    Show current page with inline errors
    Why my primary key is = :p_rowid?
    ...Execute Statement: begin begin select into from "HORSES"."TBL_DA_SUIVI_TEMPS" where "PK_DA_SUIVI_TEMPS" = :p_rowid for update ; end; end;
    Where can I change this?
    Many thanks.

    The error it occurring here:
    0.06537
    0.00337
    ...Process "Process Row of TBL_DA_SUIVI_TEMPS" - Type: DML_PROCESS_ROW
    4
    This is an "Automatic DML Process" (which is related to the "Automatic Row Fetch")
    The format of the SQL that is throwing the error seems to indicate that none of the OPs Items have "Source Type" defined as "Database Column".
    I've only seen that information automatically defined when I use "Form on Table".  OP used "Form on SQL" or "Form on Procedure";  I doubt either one will automagically set "Source Type" to "Database Column".
    As far as "Primary Key" is concern, same thing as what Amanda said. (just a different Process).
    MK

  • Database Adapter Merge with char/varchar primary key

    Hi guys,
    It seems as though merge statements in BPEL database adapters do not work if the primary key of the table contains a char/varchar. This is in Jdeveloper 10.1.3.4.0
    If I create the table below:
    create table test_merge (
      id        number primary key,
      text      varchar2(255)
    );Then the merge operation will update and insert as expected. However, if I create the same table but with id as a char/varchar, then the merge statement will never update.
    It seems like it never finds a record with the same id (if it is a char/varchar), and always attempts to insert, which results in unique key constraint errors for the primary key column.
    Has anyone else encountered this issue and found a way to get the merge statement to work correctly? I can obviously perform the select myself, and then conditionally update/insert, but I would prefer the merge to work as expected.
    Thanks

    After investigating further, it seems that even a database adapter select is not working correctly. Consider the following table:
    create table test_merge (
      id        varchar2(255) primary key,
      text      varchar2(255)
    );And I have inserted a record with id = "1" and text="abc"
    If I create a BPEL process and add a database adapter (with only the select checkbox ticked) with the following SQL:
    SELECT ID, TEXT FROM TEST_MERGE WHERE (ID = #id)If I invoke this adapter, passing in "1" as the id, then a record is returned, with the correct text (i.e. "abc") BUT the id returned is "-9900000000000000000000000000"
    Can anyone explain why this is happening?

  • Violation of PRIMARY KEY constraint in JDBC receiver

    Hi Experts !
    I am configuring a JDBC Receiver. I need to insert the records and if the same record is coming again i need to update the records in my database.So I have used action "UPDATE_INSERT". But now I am getting the error,
    "Violation of PRIMARY KEY constraint-Cannot insert duplicate key in object " .. Pls help me out !!!  It is very urgent!!
    Thanks,
    Laawanya

    Lawanya,
    It seems that you are trying to update the primary key itself..
    One thing is sure The error is related to data....
    Do this at JDBC receiver Communication channel :
    Under advanced option : use parameter "logSQLParameter" and use value "TRUE"...by this way you will be able to see the values passing through JDBC receiver .
    And then check whether the same value exist in Table or not...
    Feel free to ping for further clarification..
    Regards,

  • No primary key column???

    Hello,
    I'm attempting to create an update form that connects to a mysql database. It pulls the information correctly, but it will not update...every time I hit update I get the following error(s):
    "No Primary Key Column was set. (UPD_NO_PK_SET)"
    ...for this error, I (and several others) tried messing with the update transaction...but nothing we tried worked. The primary key column appears to be set!
    The other error was:
    "# tNG_update.prepareSQL*
    * ERROR.Trigger_UpdatePassword_AddPassword
    * ERROR.Trigger_UpdatePassword_RemoveOldPassword"
    We'd like our users, once this project is finished, to be able to update not only their information, but their passwords as well. To begin, we manually assign their passwords.
    Uhh...other than that, I am currently using Developers Toolbox, Dreamweaver CS3, Windows XP, Dell computer.
    Any/all help is greatly appreciated.
    Thank you.

    Hi Rob,
    I'm attempting to create an update form that connects to a mysql database. It pulls the information correctly, but it will not update...every time I hit update I get the following error(s):
    "No Primary Key Column was set. (UPD_NO_PK_SET)"
    ...for this error, I (and several others) tried messing with the update transaction...but nothing we tried worked. The primary key column appears to be set!
    could you please post the update page´s code on your server (as .txt file) and provide a link to this file ?
    We'd like our users, once this project is finished, to be able to update not only their information, but their passwords as well. To begin, we manually assign their passwords
    I´m sure my tutorial "Protecting your application: Update my Account" can point you in the right direction: http://www.guenter-schenk.com/tutorials/tutorial.php?id=8
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • NULL in primary keys NOT logged to exceptions table

    Problem: Inconsistent behavior when enabling constraints using the "EXCEPTIONS INTO" clause. RDBMS Version: 9.2.0.8.0 and 10.2.0.3.0
    - NULL values in primary keys are NOT logged to exceptions table
    - NOT NULL column constraints ARE logged to exceptions table
    -- Demonstration
    -- NULL values in primary keys NOT logged to exceptions table
    TRUNCATE TABLE exceptions;
    DROP TABLE t;
    CREATE TABLE t ( x NUMBER );
    INSERT INTO t VALUES ( NULL );
    ALTER TABLE t
    ADD ( CONSTRAINT tpk PRIMARY KEY (x) EXCEPTIONS INTO exceptions );
    SELECT * FROM exceptions; -- returns no rows
    -- NOT NULL column constraints logged to exceptions table
    TRUNCATE TABLE exceptions;
    DROP TABLE t;
    CREATE TABLE t ( x NUMBER );
    INSERT INTO t VALUES ( NULL );
    ALTER TABLE t MODIFY ( X NOT NULL EXCEPTIONS INTO EXCEPTIONS );
    SELECT * FROM exceptions; -- returns one row
    I would have expected all constraint violations to be logged to exceptions. I was not able to find any documentation describing the behavior I describe above.
    Can anyone tell me if this is the intended behavior and if so, where it is documented?
    I would also appreciate it if others would confirm this behavior on their systems and say if it is what they expect.
    Thanks.
    - Doug
    P.S. Apologies for the repost from an old thread, which someone else found objectionable.

    I should have posted the output. Here it is.
    SQL>TRUNCATE TABLE exceptions;
    Table truncated.
    SQL>DROP TABLE t;
    Table dropped.
    SQL>CREATE TABLE t ( x NUMBER );
    Table created.
    SQL>INSERT INTO t VALUES ( NULL );
    1 row created.
    SQL>ALTER TABLE t ADD ( CONSTRAINT tpk PRIMARY KEY (x) EXCEPTIONS INTO exceptions );
    ALTER TABLE t ADD ( CONSTRAINT tpk PRIMARY KEY (x) EXCEPTIONS INTO exceptions )
    ERROR at line 1:
    ORA-01449: column contains NULL values; cannot alter to NOT NULL
    SQL>SELECT * FROM exceptions;
    no rows selected
    SQL>
    SQL>TRUNCATE TABLE exceptions;
    Table truncated.
    SQL>DROP TABLE t;
    Table dropped.
    SQL>CREATE TABLE t ( x NUMBER );
    Table created.
    SQL>INSERT INTO t VALUES ( NULL );
    1 row created.
    SQL>ALTER TABLE t MODIFY ( X NOT NULL EXCEPTIONS INTO EXCEPTIONS );
    ALTER TABLE t MODIFY ( X NOT NULL EXCEPTIONS INTO EXCEPTIONS )
    ERROR at line 1:
    ORA-02296: cannot enable (MYSCHEMA.) - null values found
    SQL>SELECT * FROM exceptions;
    ROW_ID OWNER TABLE_NAME CONSTRAINT
    AAAkk5AAMAAAEByAAA MYSCHEMA T T
    1 row selected.
    As you can see, I get the expected error message. But I only end up with a record in the exceptions table for the NOT NULL column constraint, not for the null primary key value.

Maybe you are looking for

  • FBL1N--currency in USD

    hi gurus Can anybody help me how can i get vaues in INR in FBL1N report.. In Vendor line items, it is showing in USD , even it is import PO details, i want in INR vaules. urgent reply me thanks.. sap-mm

  • Trading scenario with AED (Tax procedure- TAXINN)

    Hi, I've a query. My client procures a material from a vendor, which he imports. When he sends invoice to my client the details are as follows- Base value- 8440 (Including BEDAEDEcsee+SEcess) VAT 4%-      338 Total invoice amt- 8778/- But vendor paas

  • Loaded the newest version of Flashplayer and now it doesn't work have plug in failure

    Loaded the latest version of Flashplayer and now I have a plug in failure everytime I need Adobe.  Tried to ninstall and reinstall and no change.  Help please

  • Standard service category usage

    hello MM Gurus, i am little bit confused how to take the advantage or utilize the functionality of standard service category . can any one explain me significance of 1. Structure of service type where it shows TXT MNO FORMAT LENGTH SEP IND T1        

  • Acrobat CC auf OS X 10.9.3 startet nicht mehr -

    oder im Besten Fall nur sehr langsam (-> Regenbogenrad). Was kann das Problem sein? Ich habe das CC-Update vor 4 Tagen installiert – hängt das evtl. damit zusammen? Wenn ich PDFs mit der Leertaste anzeigen lasse, habe ich den gleichen Effekt. Hat son