This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||
|
4D v20
column_definition
|
sql_name sql_data_type_name [(int_number)][NOT NULL [UNIQUE]] [AUTO_INCREMENT] [AUTO_GENERATE] |
||
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, UNIQUE, AUTO_INCREMENT and/or AUTO_GENERATE keywords.
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.
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);
Product: 4D
Theme: Syntax rules
4D SQL Reference ( 4D v20)