Unique constraint with condition - validation of EO levels

I have a table
create the CUSTOMER table (key number primary client_prefix,)
client_suffix Varchar2,
Number of NIN,
status number (1).
. . . . . . . .
. . . . . . . .);


I have an obligation to respect a unique constraint where NIN THAT must be unique for the Client_suffix, but the issue is that customers in rejected status
(status = 9 means that the customer is in rejected status) should be ignored.

It is a new customer can be created with the same client_suffix, combination of NIN has provided other customers
with the same combination have rejected status. If not, can not be created.

I've already implemented this in the database level. I would like to know how this can be implemented as a validation of EO levels

Jdev version 11.1.2.0.0

No, you don't need to do...

Use this technique: http://docs.oracle.com/cd/E26098_01/web.1112/e16182/bcadvgen.htm#sthref439

John

Tags: Java

Similar Questions

  • Unique constraint with conditions?

    Hi all!

    I have the following scenario... I need column UNIQUE Serial_number forced but only when the STATUS column = 'Y '. Serial_number can be non-unique, where the STATE has another value or is set to null. So, I couldn't en with this:

    SERIAL_NUMBER | STATUS
    --------------------------------------
    123456789 N
    123456789 N
    123456789 IS

    but a new line with 123456789 and 'Y' should not be allowed.

    Is this possible with a UNIQUE constraint, or what I have to set in a trigger? I was playing with the UNIQUE constraint for a while, but neither DECODE, WHERE clauses seem to be accepted...

    Thanks in advance!

    Try this:

    create unique index a1 on tab(case when STATUS = 'Y' then SERIAL_NUMBER else null end);
    

    Amiel

  • But UNIQUE constraint with a condition?

    Hello!

    Is it possible to define a unique constraint in a table that would apply only to a condition (according to the content of the line only)?

    For example:
    CREATE TABLE example
    (
      pk number,
      a number,
      b number,
      c VARCHAR2(10),
      x number
    );
     
    The constraint would be UNIQUIE (a, b), but only when x is > 10.
    So if x is not greater than 10, then the same values for a and b nd should be allowed.

    Maybe with a view?


    Like this?
    create view example_view  ( unique (a,b)) AS
    select a,b from example where x > 10
     with read only; -- ??? needed? 
    Kind regards
    David

    You can create an index based on a function. This takes advantage of the fact that Oracle does not store the NULL entries in an index b-tree

    CREATE UNIQUE INDEX idx_example
        ON example(
          (CASE WHEN x > 10 THEN a ELSE NULL END),
          (CASE WHEN x > 10 THEN b ELSE NULL END)
        );
    

    Justin

  • Question of the unique constraint with finance charge

    Hi friends,

    As part of the implementation of 11 g BIAPPS-ODI during the execution of a finance charge is my load of CM plan failed with the error like below

    ODI-1519: series step 'Load start Plan (InternalID:1242500)' failed because step 'Refresh Global Variable (InternalID:1243500)' child is in error.

    ODI-1519: series step 'Refresh Global Variable (InternalID:1243500)' failed because the step child "Warehouse loading Phase (InternalID:2336500)" is a mistake.

    ODI-1519: series step "Warehouse loading Phase (InternalID:2336500)" failed because the child step "SIL 1 charge (InternalID:2337500)" is a mistake.

    ODI-1519: series step '1 SIL Load (InternalID:2337500)' failed, because the child step '2 group of dimensions of SIL (InternalID:2338500)' is a mistake.

    ODI-1519: series step '2 group of dimensions of SIL (InternalID:2338500)' failed because the child step "Parallels - independent DimGroup (InternalID:2346500)" is a mistake.

    ODI-1518: parallel step 'Parallels - independent DimGroup (InternalID:2346500)' failed. level of 1 child by mistake, which is more than the maximum number of allowed errors (0) defined for parallel step.  Has no measures of the child: 3 SIL Dims POSHIER_DIM (InternalID:2369500)

    ODI-1519: series step '3 SIL Dims POSHIER_DIM (InternalID:2369500)' failed because the child "POSHIER_DIM (InternalID:2372500)" is a mistake.

    ODI-1519: series step "POSHIER_DIM (InternalID:2372500)" failed because step "SIL_PositionDimensionHierarchy (InternalID:2377500)" child is in error.

    ODI-1217: SILOS_SIL_POSITIONDIMENSIONHIERARCHY Session (4278500) fails with return code 1.

    ODI-1226: SIL_PositionDimensionHierarchy.W_POSITION_DH step fails after 1 attempt.

    ODI-1240: Flow Run SIL_PositionDimensionHierarchy.W_POSITION_DH fails during an operation of integration. This flow of charge table target W_POSITION_DH.

    ODI-1228: SIL_PositionDimensionHierarchy.W_POSITION_DH (integration) of the task fails when connecting ORACLE target BIAPPS_DW.

    Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (DEV_DW. W_POSITION_DH_U2) violated

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)

    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)

    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)

    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)

    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)

    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)

    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1115)

    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1488)

    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)

    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3954)

    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1539)

    at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)

    at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1895)

    to oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$ 2.doAction(StartScenRequestProcessor.java:580)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor.doProcessStartScenTask(StartScenRequestProcessor.java:512)

    to oracle.odi.runtime.agent.processor.impl.StartScenRequestProcessor$ StartScenTask.doExecute (StartScenRequestProcessor.java:1068)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:137)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    How to solve the question above using ODI 11 g. I'm using Oracle ERP R12.1.3 as a source of data for this.

    Thanks in advance.

    Kind regards

    Saro

    What is the result of a query on table W_POSITION_DH or W_POSITION_D duplicate?

    Naeem

  • Unique index with TRIM

    I want to create a unique constraint with TRIM, I get the error message. Is there a way...
    ALTER TABLE core_business.cb_pensioner ADD CONSTRAINT unique_claim_no UNIQUE(TRIM (claim_no))   deferrable initially deferred NOVALIDATE;
    
    ORA-00904: : invalid identifier

    Pre 11g - unique index; 11g go - virtual columns.

    SQL> create table t1
      2  (col1 varchar2(10));
    
    Table created.
    
    SQL> alter table t1 add constraint uk_t1 unique (trim(col1));
    alter table t1 add constraint uk_t1 unique (trim(col1))
                                                *
    ERROR at line 1:
    ORA-00904: : invalid identifier
    
    SQL> create unique index i1 on t1 (trim(col1));
    
    Index created.
    
    ... virtual column method ...
    
    SQL> drop index i1;
    
    Index dropped.
    
    SQL> alter table t1 add col2 as (trim(col1));
    
    Table altered.
    
    SQL> alter table t1 add constraint uk_t1 unique (col2);
    
    Table altered.
    
    SQL> insert into t1 (col1) values ('1');
    
    1 row created.
    
    SQL>  insert into t1 (col1) values ('1  ');
     insert into t1 (col1) values ('1  ')
    *
    ERROR at line 1:
    ORA-00001: unique constraint (RIMS.UK_T1) violated
    
    SQL> select * from t1;
    
    COL1       COL2
    ---------- ----------
    1          1
    
    SQL> 
    
  • How to display a validation on a modal dialog error based on a unique constraint?

    Hi all

    Apex 4.1

    See example on apex.oracle.com:

    Workspace: EDIAZJORGE

    User name: TEST

    Password: test123

    Application: 55036 - Validation of modal Page

    I have a page with two elements, to make and model, where the user will be able to enter the model, say, a car and use a pick to dolist. If make does not exist, the user can click on the [+] button that opens a modal dialog box to add a new do.

    Everything works fine except when I try to insert a double do, which triggers a unique constraint violation error:

    AJAX call back Server error ORA-00001: unique constraint (EDIAZJORGE. MAKE_UK1) violated to execute the PL/SQL Code

    I want to enter this event and inform the user about an error inside the modal dialog box, but I don't know what is the best way to achieve this. My guess is that I'll have to make an Ajax call to run an application process and capture the exception of DUP_VAL_ON_INDEX, but I'm not very familiar with the Ajax part.

    Any suggestions?

    Thank you

    Erick

    I'm sorry Erick, I was in error. You always get an alert but with a nicer message. The actions of builtin DA do not allow interaction with them, so no way to manage the return of ourselves.

    In light of this, I copied the page in enforcement 77635 1-2 and made some changes to it. Basically, I copied the code to Jorge and modified so that it uses $.ajax instead of apex.server.process. I much prefer it to htmldb_Get - you shouldn't really use it either. More $.ajax has the advantage of this apex.server.process is based on it. That should work well on 4.1.

    Sorry Jorge, won't steal the Thunder, I guess I was... bored? And decided to do some apex?

  • Retrieve values with a unique constraint

    All,

    It may be a stupid request and I think too speak of it. But, for some reason, I am unable to write a query to accomplish my task.

    I have the T table with some columns and the columns c1, c2, c3 are part of a composite unique constraint. Now I'm updating the value c3 from 52 to 51. But, when I do an update like:

    Update T set c3 = 51 where c3 = 52;

    I get a Unique constraint violation error.

    So, I need to know what are the values of repetition that might be causing this?

    Thanks in advance guys.

    34a22dde-3108-4F05-BE72-eb1043d28314 wrote:

    All,

    It may be a stupid request and I think too speak of it. But, for some reason, I am unable to write a query to accomplish my task.

    I have the T table with some columns and the columns c1, c2, c3 are part of a composite unique constraint. Now I'm updating the value c3 from 52 to 51. But, when I do an update like:

    Update T set c3 = 51 where c3 = 52;

    I get a Unique constraint violation error.

    So, I need to know what are the values of repetition that might be causing this?

    Thanks in advance guys.

    An inelegant way...

    select *
    from your_table tab1
    where (tab1.c1,tab1.c2) in
    (
    select tab2.c1, tab2.c2
    from your_table tab2
    where tab2.c3 = 52
    )
    where tab1.c3 = 51;
    
  • Adding a UNIQUE CONSTRAINT to an existing column with duplicate values

    Oracle Forums Hello, I have a table that contains rows 11 901. I tried to define the UNIQUE constraint on the column of xcode, but encountered an error: the column already contain duplicates! I rescued following SQL 'SELECT COUNT (*) FROM States;' the result is 11 901 and 'SELECT COUNT (DISTINCT (xcode)) FROM States;' the result is 11 680. So to enforce this unique key I have to remove the 221 lines. Please how can I do this?

    REMOVE duplicates...

    For example, as

    delete from your_table t
    where rowid <
       (
       select max(rowid)
       from your_table r
       where t.unique_column = r.unique_column);
    

    Thne create the constraint.

  • Need help with PK_REV_COL unique constraint violation

    We receive a SNPW. Violation of unique constraint of PK_REV_COL when you try to reverse a pipe delimited source file. There is no column twice in the source file name, but the same column names are used in several different input files. Does anyone have a solution to this problem?

    Hello

    Tryied to reproduce such behaviour on my side, I'm was not possible for me.

    The only one that occurs to me is, drop the current data store and recreate on...

    Cezar Santos
    [www.odiexperts.com]

  • correct handling of foreign keys in unique constraints for operations ON DELETE SET NULL

    During my troubleshooting at a client site, I came across an interesting setup where I would like to ask your opinion.


    Consider two tables ADTB and TBLB.

    ADTB:

    INT COLA1

    COLA2 INT

    TBLB:

    COLB1 INT

    COLA2 is COLB1 as a foreign key ON DELETE SET NULL value.

    COLA1 and COLA2 are combined into a UNIQUE for the BATTERY constraint.

    I have two records of TBLB:

    (1)

    (2)

    and two DRUM recordings:

    (1, 1)

    (2, 2)

    so far, all the constraints are valid.

    During my research, I learned that I can not put COLA2 null in ADTB for two lines at the same time:

    TBLA UPDATE set COLA2 = NULL where COLA1 = 1;

    -> OK

    TBLA UPDATE set COLA2 = NULL where COLA1 = 2;

    -> VIOLATED UNIQUE CONSTRAINT

    Unfortunately, it's something my application needs, anyway. In order to get this resolved, but I try to understand, what would happen if I:

    REMOVE THE TBLB;

    ?

    It should set COLA2 in ADTB "Null" on the two lines, which is not allowed due to the UNIQUE CONSTRAINT.

    Can someone shed light on this issue? Thank you.


    Yours,

    Ronny

    Unfortunately, as you say, you can't not NULL values in such a unique constraint.  It would be the same as if you had a composite primary key and try to allow one of the columns will be null in several rows with the same value in the other column.  NULL is treated as an "unknown" value, it is possible that it could be the same value (it may or may not be, but Oracle does not know), so it must assume that it might be and that's why treat it as if there is the potential for a duplicate... so it's not unique.

    In short, do not allow null values in your unique constraints.

    The default is in the drawing, not in the way that Oracle is the treatment.  Fix the design if you do not have NULL values.

    In terms of relational database design, it seems that you are trying to transform the 1:M relations M:M relations, and which requires an intermediate table if you have M:1 and 1:M between 3 tables instead.

  • How to avoid duplicates on a column with condition

    Hi all

    I need some advice here. At work, we have an Oracle APEX application that allow the user to add new records with the decision of the increment automatic number based on the year and the group name.

    Said that if they add the first record, group name AA, for 2012, they get the decision number AA 1 2013 as their record casein displayed page of the report.

    The second record of AA in 2013 will be AA 2 2013.

    If we add about 20 records, it will be AA 20 2013.

    The first record for 2014 will be AA 1 2014.

    However, recently, we get a claim of the user on two files of the same name of group have the same number of the decision.

    When I looked in the history table and find that the time gap between 2 record is about 0.1 seconds.

    In addition, we have the correspondence table which allows the user admin update the sequence number start with the restraint that it must be greater than the maximum number of the current name of the current year.

    This boot sequence number and the name of the group is stored together in a table.

    And in some other case, the user can add a decision duplicate for related record number. (this is a new feature)

    The current logic of the procedure to add the new record on the application are

    _Get max record table with selected group name (decision_number) and the current year.

    _INSERT in the folder table the new record came with the decision to number + 1

    _ update sequence number of the number of the decision just added.

    So instead of utitlising the process of editing the built-in automatic table of the APEX, I write a procedure that combine all three processes.

    I have run some loop for continually perform this procedure, and it seems that it can generate autotically new decision unique number with time about 0.1 second difference.

    However, when I increase the number of entry to 200 and let two users run 100 each.

    If the time gap is about 0.01 second, double decision numbers are displayed.

    What can I do to prevent duplicate?

    I can't just apply a unique constraint here for three columns with condition because it can be duplicated in some special conditions. I don't know much about the use of lock and its impact.

    This is the content of my procedure

    create or replace

    PROCEDURE add_new_case)

    -ID just use the trigger

    p_case_title IN varchar2,

    p_year IN varchar2,

    p_group_name IN VARCHAR2,

    -decisionnumber here

    p_case_file_number IN VARCHAR2,

    -active

    p_user in VARCHAR2

    )

    AS

    NUMBER default_value;

    caseCount NUMBER;

    seqNumber NUMBER;

    previousDecisionNumber NUMBER;

    BEGIN

    -execution immediate q '[alter session set nls_date_format = "dd/mm/yyyy"]';

    SELECT count (*)

    IN caseCount

    OF CASE_RECORD

    WHERE GROUP_ABBR = p_group_name

    AND to_number (to_char (create_date, "yyyy")) = to_number (to_char (date_utils.get_current_date, "yyyy"));

    SELECT max (decision_number)

    IN previousDecisionNumber

    OF CASE_RECORD

    WHERE GROUP_ABBR = p_group_name

    AND to_number (to_char (create_date, "yyyy")) = to_number (to_char (date_utils.get_current_date, "yyyy"));

    IF p_group_name IS NULL

    THEN seqNumber: = 0;

    ON THE OTHER

    SELECT Seq_number INTO seqNumber FROM GROUP_LOOKUP WHERE ABBREVIATION = p_group_name;

    END IF;

    IF caseCount > 0 THEN

    default_value: largest = (seqNumber, previousdecisionnumber) + 1;

    ON THE OTHER

    default_value: = 1;

    END IF;

    INSERT INTO CASE_RECORD (case_title, decision_year, GROUP_ABBR, decision_number, case_file_number, active_yn, created_by, create_date)

    VALUES (p_case_title, p_year, p_group_name, default_value, p_case_file_number, 'Y', p_user, sysdate);

    -Need to update the sequence here also

    UPDATE GROUP_LOOKUP

    SET SEQ_NUMBER = default_value

    WHERE the ABBREVIATION = p_group_name;

    COMMIT;

    EXCEPTION

    WHILE OTHERS THEN

    Logger.Error (p_message_text = > SQLERRM)

    , p_message_code = > SQLCODE

    , p_stack_trace = > dbms_utility.format_error_backtrace

    );

    LIFT;

    END;

    Many thanks in advance,

    Ann

    It's easier to solve for the case, while p_group_name is not null. In this case, you update a GROUP_LOOKUP line, so that you can select to update this line at the beginning, to prevent cases of two for the same group added at the same time. To do this, change the selection of GROUP_LOOKUP to:

    SELECT Seq_number INTO seqNumber FROM GROUP_LOOKUP WHERE ABBREVIATION = p_group_name for an updated VERSION OF the SEQ_NUMBER;

    and move this to be the first thing that did the procedure - before it has CASE_RECORD lines.

    In the case when p_group_name is set to null, you have some object to be locked. I think the best you can do is to lock the entire table GROUP_LOOKUP:

    the table lock in exclusive mode GROUP_LOOKUP wait 100;

    The '100 expectation' means that he will wait until 100 seconds before giving up and trigger an error. in practice, that is expected to only wait a moment.

    Exclusive mode allows others to read, but not to update the table.

    UPDATES and the LOCK of the TABLE will be updates of other sessions wait for this transaction to validate. Queries from other sessions are not affected.

    The locks are released when you commit or roll back.

  • Strange behavior when creating a composite with ' without validating key. '

    Hi all

    It's very strange for me. Can you please tell me where I am wrong.

    I want to create a composite key for the combination "INT_ID" and "STO_ID" columns in the table "act_ord". because this table contains already more entries in double for this combination, I decided to use 'enable novalidate' to skip validation for records duplicate already existing while creating constraints. But I get the following error "ORA-02260: table can have only one primary key" executing the below statement 1.1. If I create a 1 column with option novalidate constraint means, its working fine.
    1.1 Not working:- Giving error ORA-02260: table can have only one primary key
    ALTER TABLE ACT_ORD ADD CONSTRAINT PK_INT_ORD
     PRIMARY KEY   (INT_ID,STO_ID) enable novalidate 
    1.2 Working without any error:
    ALTER TABLE SPL_VAS.ACT_ORDER ADD CONSTRAINT PK_INT_STO_ORD
     PRIMARY KEY   (INT_ID) enable novalidate
    Is there a limitation of use 'enable novalidate' with the creation of composite primary key?

    Please take the necessary steps and make your suggestions.

    Kind regards
    Jame

    It is clear to me why you get this error. Here's a unit test where I get a different error (more logical).

    Note: to do this, you must first create a NON-unique index on the columns that you want to be in the primary key. Then use the clause for INDEXING to HELP when you add the primary key.

    SQL> create table test (i number not null, j number not null);
    
    Table created.
    
    SQL> insert into test values(0,0);
    
    1 row created.
    
    SQL> insert into test values(0,0);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select *  from test;
    More...
    
             I          J
    ---------- ----------
             0          0
             0          0
    
    2 rows selected.
    
    SQL> alter table test add primary key (i,j) enable novalidate;
    alter table test add primary key (i,j) enable novalidate
    *
    ERROR at line 1:
    ORA-02437: cannot validate (TOON.SYS_C0028830) - primary key violated
    
    SQL> create index my_pk_index on test(i,j);
    
    Index created.
    
    SQL> alter table test add primary key (i,j) using index my_pk_index enable novalidate;
    
    Table altered.
    
    SQL> insert into test values(1,1);
    
    1 row created.
    
    SQL> insert into test values(1,1);
    insert into test values(1,1)
    *
    ERROR at line 1:
    ORA-00001: unique constraint (TOON.SYS_C0028831) violated
    
    SQL>
    
  • Unique constraints

    I want to add a single validator to a feature attribute using 'list type of validator', the attribute is not the primary key.

    I'm following the userid not in userid viewobject.

    is this true?

    Hello Mohamed,

    to add a unique constraint on the entity object, you can add alternateKey "you can find it in the tab general entity ' of your entity attribute that you want to be unique and then adds unipue key validation 'entity level validation' and choose your secondary key created, then write failure management message

    Kind regards
    Karim Hasan

  • Unique constraint during the race error collecting statistics of schema

    Hello
    I get this error periodically during execution to collect statistics of schema
    In GATHER_SCHEMA_STATS , schema_name= ALL percent= 40 degree = 8 internal_flag= NOBACKUP
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    I went thru notes 470556.1 , but I have not applied patch 5876047 according to the note.

    I can truncate table FND_STATS_HIST? Is it safe to truncate this table?

    Thank you
    ARS

    Published by: user7640966 on January 2, 2011 23:58

    Hi Ars;

    If I suggest his prod, make sure you have a valid backup of your system and also raise sr and confirm with oracle support. If you are on the clone or test, such as mention of doc first to backup table FND_STATS_HIST (make sure that you have a valid backup), truncate and repeat the test question

    Respect of
    HELIOS

  • Unique constraint violation

    I just got an error of constraint unique violation when I tried to insert a row in a table.
    But even after that I deleted the PK constraint on the table in question, I still get the same error message when I try again the insert:
    SQL error: ORA-00001: unique constraint (GILLNET_TAG. DELETED_AUTH_PK) violated
    00001 00000 - "forced single (s.%s) violated."
    * Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you can see
    This message if there is an entry double at a different level.
    * Action: Either remove the single restriction or not to insert the key.

    Can someone tell me why? The removal of the constraint simply not registered with SQL Developer?
    Thank you.

    Because you have only removed the constraint, not the corresponding unique index.

    But... Why are you doing it? The unique constraint is there for a reason.

Maybe you are looking for

  • Buttons of media on satellite Pro M30

    How can I use them?I read a topic on this button, but that didn't help out me.When I open the TOSHIBA controls and go in the media tab, it says that it uses for audio and video Windows Media Player but when I play music or movies with Windows Media P

  • HP Deskjet Ink Advantage 4615: Printer is deleted when delete print queue of the printer in Win8.1

    I right click the "Delete the print queue" option in "devices and printers". Who deleted the default printer and also removed the icon of the printer. The system then made the fax printer HP 4610 series the default printer. I re - install from the we

  • Comuter has speed complications

    my computer is running extremely slow I can see my history and hidden and scanned for malware and viruses nothing popped up what he can do to speed it up?

  • Any user can get authenticated ACS SE 4.1

    Hi all I'm having a devil of a time to get a new 4.1 SE ACS configured in a new network. I have a 3560 now that I first try but I can't authenicated. I have the user/group account set up, the group is correspondence in my AAA statements although I sa

  • I need help on the matrix of action script 3.0

    I need help on the matrix of action script 3.0[Ask in the correct forum allows... Left non-technical Forum Lounge for forum specific program... MOD]