Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- CREATE INDEX ::=
- CREATE [ UNIQUE | BITMAP ] INDEX [ schema. ]index
- ON { cluster_index_clause
- | table_index_clause
- | bitmap_join_index_clause
- } ;
- table_index_clause ::=
- [ schema. ]table [ t_alias ]
- (index_expr [ ASC | DESC ]
- [, index_expr [ ASC | DESC ] ]...)
- [ index_properties ]
- index_expr ::= { column | column_expression }
- ALTER TABLE ::=
- ALTER TABLE [ schema. ]table
- [ alter_table_properties
- | column_clauses
- | constraint_clauses
- | alter_table_partitioning
- | alter_external_table_clauses
- | move_table_clause
- ]
- [ enable_disable_clause
- | { ENABLE | DISABLE }
- { TABLE LOCK | ALL TRIGGERS }
- [ enable_disable_clause
- | { ENABLE | DISABLE }
- { TABLE LOCK | ALL TRIGGERS }
- ]...
- ] ;
- constraint_clauses ::=
- { ADD { out_of_line_constraint
- [ out_of_line_constraint ]...
- | out_of_line_REF_constraint
- }
- | MODIFY { CONSTRAINT constraint
- | PRIMARY KEY
- | UNIQUE (column [, column ]...)
- }
- constraint_state
- | RENAME CONSTRAINT old_name TO new_name
- | drop_constraint_clause
- }
- out_of_line_constraint ::=
- [ CONSTRAINT constraint_name ]
- { UNIQUE (column [, column ]...)
- | PRIMARY KEY (column [, column ]...)
- | FOREIGN KEY (column [, column ]...)
- references_clause
- | CHECK (condition)
- }
- [ constraint_state ]
Add Comment
Please, Sign In to add comment