Name

CREATE/ALTER/DROP TABLE (Object Syntax)

Synopsis

CREATE Syntax:

CREATE [GLOBAL TEMPORARY] TABLE [schema.]table_name  
  OF [schema.]object_type 
( { { column | attribute} [DEFAULT expr] 
    { SCOPE IS [schema.]scope_table_name]
    | WITH ROWID 
    | [CONSTRAINT constraint_name]  REFERENCES [schema.]object_table
        [ON DELETE CASCADE]
    }
|          { SCOPE FOR ({column | attribute}) IS [schema.]table_name |
              REF ({column | attribute}) WITH ROWID 
     | [CONSTRAINT constraint_name] FOREIGN KEY (column)
              REFERENCES [schema.]object_table [ON DELETE CASCADE]
              [Constraint_State_Clause]
         }
)
[OBJECT ID {SYSTEM GENERATED | PRIMARY KEY}] 
[ON COMMIT {DELETE | PRESERVE} ROWS]
[OIDINDEX [indexname] ([physical_attributes_clause] 
[TABLESPACE tablespace_name])]
[Physical_Attributes_Clause]
[TABLESPACE_NAME tablespace_name]   
[Storage_Clause]
[LOGGING | NOLOGGING]
[CLUSTER (column[,column ...]]
[ { ORGANIZATION HEAP  
     [Physical_Attributes_Clause]
     [TABLESPACE tablespace_name]   
     [Storage_Clause]
     [LOGGING | NOLOGGING] 
  | ORGANIZATION INDEX  
     [PCTTHRESHOLD integer]
     [COMPRESS integer | NOCOMPRESS]
     [Physical_Attributes_Clause]
     [TABLESPACE tablespace_name]   
     [Storage_Clause]
     [LOGGING | NOLOGGING]
     [[INCLUDING column] OVERFLOW
       [Physical_Attributes_Clause]
       [TABLESPACE tablespace_name]   
       [Storage_Clause]
       [LOGGING | NOLOGGING]]
  }
[LOB 
  {(lob_item[,lob_item...]) STORE AS
    (LOB_Parameter_Clause)
  | (lob_item) STORE AS [(lob_segname)]
     [(LOB_Parameter_Clause)] ]
     [VARRAY varray_item STORE AS LOB [lob_segname]
       [(LOB_Parameter_Clause)]]
     [NESTED TABLE nested_table ...

Get Oracle in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.