Neoview SQL Reference Manual (R2.3)
NOT NULL
is a column constraint that specifies that the column cannot contain nulls. If you omit NOT
NULL, nulls are allowed in the column. If you specify both NOT NULL and NO DEFAULT,
each row inserted in the table must include a value for the column. See “Null” (page 240).
PRIMARY KEY [ASC[ENDING] | DESC[ENDING]] or PRIMARY KEY (key-column-list)
is a column that specifies a column or set of columns as the primary key for the table.
key-column-list cannot include more than one occurrence of the same column.
ASCENDING and DESCENDING specify the direction for entries in one column within the
key. The default is ASCENDING.
The PRIMARY KEY value in each row of the table must be unique within the table. Columns
within a PRIMARY KEY cannot contain nulls. A PRIMARY KEY defined for a set of columns
implies that the column values are unique and not null. You can specify PRIMARY KEY only
once on any CREATE TABLE statement.
Neoview SQL uses the primary key as the clustering key of the table in order to avoid creating
a separate, unique index to implement the primary key constraint.
If you do not specify a PRIMARY KEY constraint, Neoview SQL cannot implement the
primary key as the clustering key.
CHECK (condition)
is a constraint that specifies a condition that must be satisfied for each row in the table. See
“Search Condition” (page 258).
Neoview SQL checks the condition whenever an operation occurs that might affect its value.
The operation is allowed if the predicate in the condition evaluates to TRUE or null but
prohibited if the predicate evaluates to FALSE.
You cannot refer to the CURRENT_DATE, CURRENT_TIME, or CURRENT_TIMESTAMP
function in a CHECK constraint, and you cannot use subqueries in a CHECK constraint.
CHECK constraints cannot contain non-ISO88591 string literals.
NOT CASESPECIFIC
is a column constraint that specifies that the column contains strings that are not case specific.
The default is CASESPECIFIC. Comparison between two values is done in a case insensitive
way only if both are case insensitive. This applies to comparison in a binary predicate, LIKE
predicate, and POSITION/REPLACE string function searches. See “Examples of CREATE
TABLE” (page 78).
LIKE source-table [include-option]...
directs Neoview SQL to create a table like the existing table, source-table, omitting
constraints (with the exception of the NOT NULL and PRIMARY KEY constraints), and
partitions unless include-option clauses are specified.
source-table
is the ANSI logical name for the existing table and must be unique among names of tables,
views, and procedures within its schema.
The include-option clauses are specified as:
WITH CONSTRAINTS
directs Neoview SQL to use constraints from source-table. Constraint names for
table are randomly generated unique names.
When you perform a CREATE TABLE LIKE, whether or not you include the WITH
CONSTRAINTS clause, the target table will have all the NOT NULL column constraints
that exist for the source table with different constraint names.
WITH PARTITIONS
directs Neoview SQL to use partition definitions from source-table. Each new table
partition resides on the same volume as its original source-table counterpart. The
CREATE TABLE Statement 73