【发布时间】:2009-05-07 22:10:04
【问题描述】:
我想在 Oracle 10g 中创建一个可延迟的唯一功能索引。
我知道如何创建唯一的函数索引:
create unique index LIST_ITEM_ENTRY_NO_UNIQ
on LIST_ITEM (case status when 'cancel' then null else LIST_KEY end,
case status when 'cancel' then null else ENTRY_NO end);
我知道如何创建可延迟的唯一索引:
alter table LIST_ITEM add constraint LIST_ITEM_ENTRY_NO_UNIQ
unique (LIST_KEY,ENTRY_NO) deferrable initially deferred;
知道这两件事,我尝试了这个:
alter table LIST_ITEM add constraint LIST_ITEM_ENTRY_NO_UNIQ
unique (case STATUS when 'cancel' then null else LIST_KEY end,
case STATUS when 'cancel' then null else ENTRY_NO end)
deferrable initially deferred;
但我收到“ORA-00904:无效标识符”错误。要么我的语法错误,要么 Oracle 不支持可延迟的功能索引?有人可以为我提供解决方案或明确的答案吗?
【问题讨论】:
标签: oracle indexing unique ora-00904