Guest User

Untitled

a guest
Jun 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. create unique index LIST_ITEM_ENTRY_NO_UNIQ
  2. on LIST_ITEM (case status when 'cancel' then null else LIST_KEY end,
  3. case status when 'cancel' then null else ENTRY_NO end);
  4.  
  5. alter table LIST_ITEM add constraint LIST_ITEM_ENTRY_NO_UNIQ
  6. unique (LIST_KEY,ENTRY_NO) deferrable initially deferred;
  7.  
  8. alter table LIST_ITEM add constraint LIST_ITEM_ENTRY_NO_UNIQ
  9. unique (case STATUS when 'cancel' then null else LIST_KEY end,
  10. case STATUS when 'cancel' then null else ENTRY_NO end)
  11. deferrable initially deferred;
  12.  
  13. CREATE INDEX ::=
  14.  
  15. CREATE [ UNIQUE | BITMAP ] INDEX [ schema. ]index
  16. ON { cluster_index_clause
  17. | table_index_clause
  18. | bitmap_join_index_clause
  19. } ;
  20.  
  21. table_index_clause ::=
  22.  
  23. [ schema. ]table [ t_alias ]
  24. (index_expr [ ASC | DESC ]
  25. [, index_expr [ ASC | DESC ] ]...)
  26. [ index_properties ]
  27.  
  28. index_expr ::= { column | column_expression }
  29.  
  30. ALTER TABLE ::=
  31. ALTER TABLE [ schema. ]table
  32. [ alter_table_properties
  33. | column_clauses
  34. | constraint_clauses
  35. | alter_table_partitioning
  36. | alter_external_table_clauses
  37. | move_table_clause
  38. ]
  39. [ enable_disable_clause
  40. | { ENABLE | DISABLE }
  41. { TABLE LOCK | ALL TRIGGERS }
  42. [ enable_disable_clause
  43. | { ENABLE | DISABLE }
  44. { TABLE LOCK | ALL TRIGGERS }
  45. ]...
  46. ] ;
  47.  
  48. constraint_clauses ::=
  49. { ADD { out_of_line_constraint
  50. [ out_of_line_constraint ]...
  51. | out_of_line_REF_constraint
  52. }
  53. | MODIFY { CONSTRAINT constraint
  54. | PRIMARY KEY
  55. | UNIQUE (column [, column ]...)
  56. }
  57. constraint_state
  58. | RENAME CONSTRAINT old_name TO new_name
  59. | drop_constraint_clause
  60. }
  61.  
  62. out_of_line_constraint ::=
  63. [ CONSTRAINT constraint_name ]
  64. { UNIQUE (column [, column ]...)
  65. | PRIMARY KEY (column [, column ]...)
  66. | FOREIGN KEY (column [, column ]...)
  67. references_clause
  68. | CHECK (condition)
  69. }
  70. [ constraint_state ]
Add Comment
Please, Sign In to add comment