Creating a Table : Create Table « Table « Oracle PL/SQL Tutorial






The simplified syntax for the CREATE TABLE statement is as follows:

CREATE [GLOBAL TEMPORARY] TABLE table_name (
  column_name type [CONSTRAINT constraint_def DEFAULT default_exp]
  [, column_name type [CONSTRAINT constraint_def DEFAULT default_exp]...]
)
[ON COMMIT {DELETE | PRESERVE} ROWS]
TABLESPACE table_space;

where

  1. GLOBAL TEMPORARY specifies that the table's rows are temporary and such tables are known as temporary tables.
  2. The duration of the contents are specified by the ON COMMIT clause.
  3. A temporary table is visible to all sessions, but rows are specific to a session.
  4. type specifies the type of a column.
  5. constraint_def specifies the definition of a constraint on a column.
  6. default_exp specifies the expression used to assign a default value to a column.
  7. ON COMMIT controls the duration of the rows in a temporary table.
  8. DELETE specifies the rows are deleted at the end of a transaction.
  9. PRESERVE specifies the rows are deleted at the end of a session.
  10. If you omit ON COMMIT for a temporary table, the default is DELETE.








6.1.Create Table
6.1.1.Creating a Table
6.1.2.Create table with storage setting
6.1.3.Create table with storage setting 2
6.1.4.Create an external table
6.1.5.Create copy table
6.1.6.Create a table from one or more other tables
6.1.7.Rename a table
6.1.8.One column with three constraints
6.1.9.Use referencing columns
6.1.10.Create a table based on a hash cluster
6.1.11.Create table with 'organization index OVERFLOW'
6.1.12.Create table with 'organization index'
6.1.13.Cascade delete setting
6.1.14.Demonstrate a simple External table
6.1.15.Create intermediate table for calculation
6.1.16.Make myCode a CACHE table.