I'd like to create a deferrable unique functional index in Oracle 10g.
I know how to create a unique functional index:
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);
I know how to create a deferrable unique index:
alter table LIST_ITEM add constraint LIST_ITEM_ENTRY_NO_UNIQ
unique (LIST_KEY,ENTRY_NO) deferrable initially deferred;
Knowing these two things, I tried this:
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;
But I get an "ORA-00904 : invalid identifier" error. Either I've got the syntax wrong, or perhaps Oracle doesn't support deferrable functional indices? Could someone provide me with a solution or else a definitive answer?