User Defined Columns

Windows

Last modified: January 09, 2012

Applies to: Windows | Windows Server

User defined columns are columns whose default values are provided by a callback function. These columns are always tagged and set to the value computed by the callback function. This value must be stable for each row in the table. The callback function is only used when either the application or the database engine itself needs to read the value of the column for a given row. The application has the option to override the default value and set a specific value in the column. When the default value is overridden in the columns, it uses space in the row, otherwise user defined default columns do not use space in the record.

User defined defaults option is set in the grbit member of the JET_COLUMNDEF structure in the call to JetAddColumn. The pvDefault parameter of the JetAddColumn function points to a JET_USERDEFINEDDEFAULT structure, that contains the name of the callback function in the szCallback member, and the data that is passed to the callback in the pbUserData member.

Show: