Previous Topic: ExampleNext Topic: Description


CREATE TABLE

In the following table, YES indicates a valid execution method for this statement.

This SQL statement can be executed in the following ways:

Through the Datadictionary Interactive SQL Service Facility (interactive)

In an application program prepared using a CA Datacom/DB SQL Preprocessor (embedded)

By using CA Dataquery (SQL & Batch Modes)

CREATE TABLE

YES

YES

YES

Note: To learn about using SQL keywords in CA Dataquery, see the CA Dataquery User Guide. For information about the access rights required to execute this statement, see the CA Datacom/DB Database and System Administration Guide.

Note: If you are using CA Datacom/DB as part of the CA Datacom/AD environment, you cannot use the CREATE TABLE statement.

CREATE TABLE defines a table. In this statement, you must specify:

Optional specifications include:

When a CREATE TABLE statement successfully executes, a TABLE entity-occurrence is defined in Datadictionary in PRODuction status, cataloged to the CA Datacom/DB Directory (CXX), and is ready to be populated with data. See the CA Datacom/DB SQL User Guide for information about the results in Datadictionary of using the CREATE TABLE statement.

With regard to table partitioning, CREATE statements may not be issued against a table which is partitioned nor against a partition. An SQL integrity constraint cannot reference a partitioned table, nor a partition of a partitioned table. That is to say, constraints and partitioned tables are mutually exclusive.

Note: For more information about table partitioning, see the CA Datacom/DB Database and System Administration Guide.

Following is the syntax diagram for the CREATE TABLE statement:

                                ┌─ , ───────────────────────────────┐
►►─ CREATE TABLEtable-name ─ ( ─▼─┬─ column definition ───────────┬─┴─ ) ─────►
                                  └─ table constraint definition ─┘

 ►─┬───────────────┬─┬────────────────────┬───────────────────────────────────►◄
   └─ INarea-name ─┘ └─ DATACOM NAMEname ─┘

Note: