Add Argument Definitions
When creating a column in a table using the dictionary methods, the information provided must confirm to the following specification. Each column created has a number of mandatory and optional parameters.
$fields is a string, not an array
The basic syntax of the attributes is as follows:
/* * Correct syntax */ $flds = " COL1 C(60) NOTNULL DEFAULT 'abc', COL2 I8 NOTNULL DEFAULT 0 "; /* * Incorrect syntax */ $flds = " COL1 C(60) NOTNULL DEFAULT 'abc', COL2 I8 NOTNULL DEFAULT 0 ";
The following optional arguments may also be assigned to the column, table or key. If the attribute is inappropriate for the operation or column type or not supported by the DBMS, it is ignored.
Usage: Column
Creates the column as auto-increment. Support for this varies from one database to another. Some databases designate a field with an auto-increment flag as the primary key.
Autoincrement is a synonym for AUTO
Usage: Index
Usage: Column
DEF indicates a default value for a column when a row is created. Some databases also require a field with a default value to be designated as NOT NULL, so that is automatically added to the column string
DEFAULT is a synonym for DEF
Usage: Column
Usage: Index
Usage: Index
UNIQUE is an option against a key and indicates that duplicate values across all columns in the key are not allowed.