ALLBASE/SQL Reference Manual (36216-90216)
Chapter 10 357
SQL Statements A - D
CREATE TABLE
SQL Syntax—Column Definition
ColumnName
{
ColumnDataType
LongColumnType
[IN
DBEFileSetName2
]}
[LANG =
ColumnLanguageName
]
[[NOT]CASE SENSITIVE]
[DEFAULT{
Constant
USER
NULL
CurrentFunction
}]
[NOT NULL [{UNIQUE
PRIMARY KEY} [CONSTRAINT
ConstraintID
]]
REFERENCES
RefTableName
[(
RefColumnName
)][CONSTRAINT
ConstraintID
]]
[...]
CHECK (SearchCondition) [CONSTRAINT ConstraintID]
[IN
DBEFileSetName3
] ][...]
Parameters—Column Definition
ColumnName
is the name to be assigned to one of the columns in the new table. No two
columns in the table can be given the same name. You can define a
maximum of 1023 columns in a table.
ColumnDataType
indicates what type of data the column can contain. Some data types
require that you include a length. See the "Data Types" chapter for the
data types that can be specified.
LongColumnType
specifies a LONG data type for the new column. At most 40 columns
with a
LongColumnType
may be defined in a single table.
DBEFileSetName2
specifies the DBEFileSet where long column data is to be stored. This
DBEFileSet may be different from that of the table. If a DBEFileSet is not
specified, the LONG data is stored in the DBEFileSet containing the table.
ColumnLanguageName
specifies the language for the column. This can only be specified
for CHAR or VARCHAR columns. This name must be either n-computer or
the language of the DBEnvironment. The default is the language of the
DBEnvironment.
CASE SENSITIVE indicates that upper and lower case letters stored in the column are not
considered equivalent. If the column is defined as NOT CASE
SENSITIVE, then its upper and lower case letters are considered
equivalent. The default is CASE SENSITIVE. This clause is allowed only
with CHAR and VARCHAR columns.
DEFAULT specifies the default value to be inserted for this column. The default can
be a constant, NULL, or a date/time current function The data type of the
default value must be compatible with the data type of the column.
DEFAULT cannot be specified for LONG data type columns.
NOT NULL means the column cannot contain null values. If NOT NULL is specified,
any statement that attempts to place a null value in the column is
rejected. However, if atomicity is set to row level, only the NULL row
receives the error and the statement halts.