구문에 어떤 문제가 있는지 설명 할 수 있습니까? 나는 제약 조건 프라이 머리 키와 고유를 추가하고 싶지만 또한 동일한 인덱스 (복합 인덱스)를 사용하고 싶다.온라인 SQL 색인 작성 문제가 발생했습니다. 오라클
create table val (
val1 number, val2 number,
constraint val_pk primary key(val1) using index(create index val_index on val(val1,val2)),
constraint val_unique unique (val2) using index val_index);
은 그 오류를 나에게 답변을
create table val (
val1 number, val2 number,
constraint val_pk primary key(val1) using index(create index val_index on val(val1,val2)),
constraint val_unique unique (val2) using index val_index)
Error report -
SQL Error: ORA-14196: Specified index cannot be used to enforce the constraint.
14196. 00000 - "Specified index cannot be used to enforce the constraint."
*Cause: The index specified to enforce the constraint is unsuitable
for the purpose.
*Action: Specify a suitable index or allow one to be built automatically.
감사를 제공합니다.
왜'val1, val2'의 색인은'val2'에 유일한 제약을 적용하는 데 적합할까요? 'val_index'를 반대 순서로 정의 할 수 있습니까? –