新人上路求罩 oracle 问题 ora-00001 唯一约束问题
建表语句:
-- -- Create table --- ----
create table RP_BUSI_RECORD
(
done_code NUMBER(12) not null,
parent_done_code NUMBER(12),
done_date DATE not null,
take_date NUMBER(8),
busi_code NUMBER(7) not null,
busi_status NUMBER(1) not null,
busi_origin NUMBER(1) not null,
pay_fee NUMBER(12),
get_fee NUMBER(12),
op_id NUMBER(12),
org_id NUMBER(12),
region_id VARCHAR2(6),
county_code VARCHAR2(6),
finish_date DATE,
error_reason VARCHAR2(256),
ext_col1 VARCHAR2(32),
ext_col2 VARCHAR2(32),
ext_col3 VARCHAR2(32),
memo VARCHAR2(256)
)
-----------------------------------------------------------------------------------------------------------------
中间一部分无关的我就不上了
-------------------------------------------------------------------------------------------------------------------
create index IDX_RP_BUSI_RECORD_1 on RP_BUSI_RECORD (DONE_DATE)
tablespace TEST_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
create index IDX_RP_BUSI_RECORD_2 on RP_BUSI_RECORD (BUSI_CODE)
tablespace TEST_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
create index IDX_RP_BUSI_RECORD_3 on RP_BUSI_RECORD (TAKE_DATE)
tablespace TEST_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
create unique index PK_RP_BUSI_RECORD_N on RP_BUSI_RECORD (DONE_CODE)
tablespace TEST_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-------------------------------------------------------------
alter table RP_BUSI_RECORD
add constraint PK_RP_BUSI_RECORD primary key (DONE_CODE);
插入语句:
insert into RP_BUSI_RECORD(REGION_ID,
OP_ID,
COUNTY_CODE,
BUSI_CODE,
DONE_DATE,
BUSI_ORIGIN,
TAKE_DATE,
BUSI_STATUS,
DONE_CODE,
FINISH_DATE,
ORG_ID)
values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
报错:
ORA-00001: 违反唯一约束条件 (RPT.PK_RP_BUSI_RECORD)