Neoview SQL Reference Manual (R2.2)

disk at the time of table creation. When a partitioned table is created, the table is
automatically partitioned across all the disk volumes on the system.
For a non-partitioned table, the space allocated after you enter the first row is 100 MB.
DISK POOLpool_number
causes the table to be created in the specified pool number. The value of pool_number is
an unsigned integer. Zero (0) is not a valid pool number. If pool_number is greater than
the number of pools or if pool_number is an invalid number, an error is generated.
ALIGNED | PACKED FORMAT
specifies if the table should be created in the new or old record format.
ALIGNED FORMAT is the default format if no keyword is supplied. In this format, the columns
are all properly aligned and records are aligned with data blocks.
PACKED FORMAT is the format where all columns are packed together and records are packed
together within data blocks.
Indexes and materialized views do not have ALIGNED and PACKED format but they inherit
the format of the underlying table.
If the row format phrase appears more than once within the ATTRIBUTES clause, an error
is issued.
AS select-query
specifies a select query which is used to populate the created table. A select query can be any
SQL select statement.
column data-type
specifies the name and data type for a column in the table. At least one column definition is
required in a CREATE TABLE statement.
column is an SQL identifier. column must be unique among column names in the table. If
the name is a Neoview SQL reserved word, you must delimit it by enclosing it in double
quotes. Such delimited parts are case-sensitive. For example: "join".
data-type is the data type of the values that can be stored in column. A default value must
be of the same type as the column, including the character set for a character column. “Data
Types” (page 197).
DEFAULT default | NO DEFAULT
specifies a default value for the column or specifies that the column does not have a default
value. “DEFAULT Clause” (page 258).
identity-column-specification
indicates that a particular column is an IDENTITY column. The GENERATED BY DEFAULT
indicates that the system will generate values for this column by default. See “Generating
Unique Values For a Column” (page 75).
CONSTRAINT constraint
specifies a name for the column or table constraint. constraint must have the same schema
as table and must be unique among constraint names in its schema. If you omit the schema
portions of the name you specify in constraint, Neoview SQL expands the constraint
name by using the schema for table. See “Database Object Names” (page 196).
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 230).
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.
72 SQL Statements