8. OpenSQL Statements : CREATE TABLE : Syntax
 
Share this page                  
Syntax
The CREATE TABLE statement has the following format:
[EXEC SQL] CREATE TABLE table_name
              (column_specification {, column_specification }
              [WITH with_clause]
The CREATE TABLE...AS SELECT statement (which creates a table and load rows from another table) has the following format:
[EXEC SQL] CREATE TABLE table_name
              [(column_name {, column_name})] AS
                            subselect
                            {UNION [ALL]
                            subselect}
              [WITH with_clause]
table_name
Defines the name of the new table, which must be a valid object name (see Rules for Naming Objects).
column_specification
Defines the characteristics of the column, as described in Column Specification (see page Column Specification—Describe Column Characteristics).
AS
Causes the table that you create to be defined and populated by the subselect.
subselect
Specifies a SELECT clause, as described in Using Create Table...As Select (see page Using Create Table...As Select).
WITH with_clause
Specifies Enterprise Access product-specific options. For details,see your Enterprise Access product guide.For an overview of the Enterprise Access product WITH clause, see the chapter "OpenSQL Features."