5.4.4. RECREATE TABLE

Used for

creating a new table (relation) or recreating an existing one

Available in

DSQL

Syntax

  1. RECREATE [GLOBAL TEMPORARY] TABLE tablename
  2. [EXTERNAL [FILE] 'filespec']
  3. (<col_def> [, {<col_def> | <tconstraint>} ...])
  4. [ON COMMIT {DELETE | PRESERVE} ROWS]

See the CREATE TABLE section for the full syntax of CREATE TABLE and descriptions of defining tables, columns and constraints.

RECREATE TABLE creates or recreates a table. If a table with this name already exists, the RECREATE TABLE statement will try to drop it and create a new one. Existing dependencies will prevent the statement from executing.

Example

Creating or recreating the COUNTRY table.

  1. RECREATE TABLE COUNTRY (
  2. COUNTRY COUNTRYNAME NOT NULL PRIMARY KEY,
  3. CURRENCY VARCHAR(10) NOT NULL
  4. );

See also

CREATE TABLE, DROP TABLE