column_definition

4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next

version 11


sql_name sql_data_type_name [(int_number)][NOT NULL [UNIQUE]]

Description

A column_definition contains the name (sql_name) and data type (sql_data_type_name) of a column. You can also pass an optional int_number as well as the NOT NULL and/or UNIQUE keywords. Passing NOT NULL in the column_definition means that the column will not accept null values. Passing UNIQUE means that the same value may not be inserted into this column twice (except for NULL values, which are not considered to be identical).

Each column must have a data type. The column should either be defined as "null" or "not null" and if this value is left blank, the database assumes "null" as the default. The data type for the column does not restrict what data may be put in that column.

Example

Here is a simple example which creates a table with two columns (ID and Name):

   CREATE TABLE ACTOR_FANS
    (ID INT32, Name VARCHAR NOT NULL UNIQUE);

See Also

ALTER TABLE, CREATE TABLE, sql_data_type_name.


4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next