在oracle里面违反完整约束条件的意思有两个,一个是主键重复,还有就是null不能直接BETWEEN

解决方案 »

  1.   

    如果400-500的确没有记录的话(不知道是不是你说的‘空记录’的意思)
    应该是没问题。
    你应该查一下,no为400-500之间的记录是否存在,如果存在NO为主键,肯定
    不允许UPDATE成一条已经存在的记录。
      

  2.   

    没人理呢?应该是约束问题,怎么把相应的约束停掉,再启用.alter table company_tab disable primary key?
      

  3.   

    alter table company_tab drop primary key;alter table company_tab drop CASCADE CONSTRAINTS;
      

  4.   

    CREATE TABLE t1 (
       pk NUMBER PRIMARY KEY,
       fk NUMBER,
       c1 NUMBER,
       c2 NUMBER,
       CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,
       CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0),
       CONSTRAINT ck2 CHECK (c2 > 0)
    );
    An error will be returned for the following statements: ALTER TABLE t1 DROP (pk); -- pk is a parent key
    ALTER TABLE t1 DROP (c1);  -- c1 is referenced by multicolumn
                               constraint ck1
    Submitting the following statement drops column pk, the primary key constraint, the foreign key constraint, ri, and the check constraint, ck1: ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS;
    If all columns referenced by the constraints defined on the dropped columns are also dropped, then CASCADE CONSTRAINTS is not required. For example, assuming that no other referential constraints from other tables refer to column pk, then it is valid to submit the following statement without the CASCADE CONSTRAINTS clause: ALTER TABLE t1 DROP (pk, fk, c1);
      

  5.   

    各位兄弟,谢谢了,我用的停/启约束如下:ALTER TABLE company_tab
    DISABLE/ENABLE CONSTRAINT fkey_compay_no然后update就可以了