我是直接输入的update:
update LXWMXXB L set L.LXWMXXB_ID=201208311346401653140,L.LXDW='asdfd',L.LXFS='sdfdf'建表语句如下,是不是哪里没设置好?
-- Create table
create table LXWMXXB
(
  lxwmxxb_id VARCHAR2(32) not null,
  sj         DATE,
  lxdw       VARCHAR2(50),
  lxfs       VARCHAR2(200)
)
tablespace ZF
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
-- Add comments to the table 
comment on table LXWMXXB
  is '联系我们信息表';
-- Add comments to the columns 
comment on column LXWMXXB.lxwmxxb_id
  is '联系我们信息表';
comment on column LXWMXXB.sj
  is '添加时间';
comment on column LXWMXXB.lxdw
  is '联系单位';
comment on column LXWMXXB.lxfs
  is '联系方式';
-- Create/Recreate primary, unique and foreign key constraints 
alter table LXWMXXB
  add constraint PK_LXWMXXB_ID primary key (LXWMXXB_ID)
  using index 
  tablespace ZF
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
求解决 谢谢给位了

解决方案 »

  1.   

    LXWMXXB_ID这个是主键,你的记录是否多于一条,多于一条你这样更新肯定有问题,加个where条件,更新表的主键一般不建议这样做
    方法1:加个where条件,把你的此列LXWMXXB_ID值都设为唯一的,就可以了
    方法2:删除这个主键 alter table LXWMXXB drop constraint PK_LXWMXXB_ID 
    方法3:禁用主键检查约束,但一般不这样做 alter table LXWMXXB disable constraint PK_LXWMXXB_ID update LXWMXXB L set L.LXWMXXB_ID=201208311346401653140
    ,L.LXDW='asdfd',L.LXFS='sdfdf'
    where 你的条件
      

  2.   


     lxwmxxb_id 是主键,你这个更新语句要把所有记录的主键都更新成1个值,当然违反唯一性榆约束.你确定你想要这么更新么?
      

  3.   

    我修改了一下:
    update LXWMXXB L set L.LXDW='asdfd',L.LXFS='sdfdf'
    where  L.LXWMXXB_ID=201208311346401653140
    虽然不报错了,但是这条语句没效果,不能修改对应行。再帮我看看 谢谢了。
      

  4.   

    你想修改哪行啊。
    lxwmxxb_id啊是主键,不能相同的。
      

  5.   

    LXWMXXB_ID 是主键,
    update LXWMXXB L set L.LXWMXXB_ID=201208311346401653140,L.LXDW='asdfd',L.LXFS='sdfdf'其中201208311346401653140 是不能重复的
      

  6.   

    你胆子不小啊 ,没有任何条件 都敢 UPdate ,主键是唯一的,你这已更新所有的 主键都一样了,不报错就真的见鬼了
      

  7.   

    lxwmxxb_id是主键,更新的时候不能有两个一样的改成别的就好了
      

  8.   

    update LXWMXXB L set L.LXWMXXB_ID=201208311346401653140,L.LXDW='asdfd',L.LXFS='sdfdf'没有写WHERE条件