When a base table is created or modified (CREATE TABLE, ALTER TABLE), the column definition defines the name and the attributes of a column.
Every column has a name and a data type. Refer to section “Data types” for a list of the data types which can be specified in SESAM/SQL.
SESAM/SQL distinguishes between atomic and multiple columns. In an atomic column, exactly one value can be stored in each row. In a multiple column, several values of the same type can be stored in each row. A multiple column is made up of a number of column elements. In the case of a single column, a single value is stored for each row.
The value of a multiple column in a row is referred to as an aggregate and the value of a single column element in a row is referred to as an occurrence. An aggregate is made up of the occurrences of the individual column elements.
It is possible to reference either a column element or a contiguous range of column elements in a multiple column. A single element is specified in the form column[n] (or column(n)) and a range is specified in the form column[n..m] (or column(n..m)), where m>n>0.
In order to integrate BLOB objects in “normal” SQL base tables, the FOR REF is used to define a REF column. This can then contain references that point to the BLOB values of a BLOB table. BLOB objects, tables and REF values are described in detail in section “BLOB constructs”.
Within a column definition, a default value for a single column can be defined. If a single column does not contain a value when a row is inserted, the column is assigned the default value. The default value can be specified as a literal, a date function, one of the special literals CURRENT_USER or SYSTEM_USER or the value NULL. The default value must be compatible with the data type for the column and must comply with any integrity constraint. SESAM/SQL enters the REF value of the class by default in the REF column. This designates the entire class of BLOB values for the BLOB table specified in the FOR REF clause.
The CONSTRAINT clause allows you to define an integrity constraint (see section “Integrity constraint”) for the column.
In the case of CALL DML tables, the CALL DML clause specifies the non-significant value and the column name.