OpenSQL Reference Guide > OpenSQL Reference Guide > OpenSQL Statements > CREATE TABLE > Column Specification--Describe Column Characteristics
Was this helpful?
Column Specification--Describe Column Characteristics
The column_specification in a CREATE TABLE statement describes the characteristics of the column.
This statement has the following format:
column_name datatype [WITH NULL | NOT NULL]
where:
column_name
Assigns a name to the column. It can be any valid OpenSQL name.
datatype
Assigns a valid OpenSQL data type and length to the column. If CREATE TABLE...AS SELECT is specified, the new table takes its column names and formats from the results of the SELECT clause of the subselect specified in the AS clause (unless different column names are specified).
WITH NULL | NOT NULL
Specifies whether the column accept nulls during an insert, update, or copy operation. The options are:
WITH NULL
Accepts nulls. The DBMS Server inserts null as the default value if no value is supplied by the user.
This is the default if the clause is omitted.
NOT NULL
Does not accept nulls. The DBMS does not supply a default value. The user must supply a non‑null value. (The column is mandatory.)
Last modified date: 11/09/2022