ctdbSetFieldNullFlag
Enable or disable the SQL “NOT NULL” property of this field's column, in order to control whether the SQL layer will allow NULL values to be written to fields in this column or not.
Declaration
CTDBRET ctdbSetFieldNullFlag(CTHANDLE Handle, CTBOOL flag)
Description
The FairCom DB API null flag controls the NOT NULL property of a column. Setting this column property has no effect on individual record null values: it is NOT enforced at the FairCom DB API layer. This attribute only applies to the FairCom DB SQL layer for constraint on values. It is useful to set this flag in c-tree data files before SQL import such that the property is maintained.
Note: this is a schema change for an entire column and has nothing to do with individual records from the table. See ctdbIsNullField and ctdbClearField to edit NULL values of single fields in single records. This schema change works as follows: a TRUE Null Flag sets / enables the SQL “NOT NULL” property of the column, which means that that column is not allowed to have NULL values. A FALSE Null Flag disables the SQL “NOT NULL” property of the column, which means that that column is allowed to have NULL values.
Returns
ctdbSetFieldNullFlag() returns CTDBRET_OK on success, or a FairCom DB API C API error code on failure.
See also
ctdbGetFieldNullFlag()