Product Documentation

V9 Update Guide

Previous Topic

Next Topic

Default Values for Alter Table Operations

c-treeDB’s alter table function can be used to alter the schema of an existing table by adding new fields or modifying existing fields of the specified table. A new feature has been introduced to allow the alter table function to support a default field value specification. During an alter table operation, when a new field is added to the table, or when an existing field type is changed, an optional default field value can be specified for these fields.

The following functions have been added to the c-treeDB APIs enabling this capability.

c-treeDB C API

  • ctdbSetFieldDefaultValue()
  • ctdbGetFieldDefaultValue()
  • ctdbIsFieldDefaultValue()
  • ctdbClearFieldDefaultValue()
  • ctdbClearAllFieldDefaultValue()
  • ctdbSetFieldDefaultDateTimeType()
  • ctdbGetFieldDefaultDateType()
  • ctdbGetFieldDefaultTimeType()

c-treeDB C++ API

  • CTField::SetFieldDefaultValue()
  • CTField::GetDefaultfieldValue()
  • CTField::IsFieldDefaultValueSet()
  • CTField::ClearFieldDefaultValue()
  • CTTable::ClearAllFieldDefaultValue()
  • CTField::SetFieldDefaultDateTimeType()
  • CTField::GetFieldDefaultDateType()
  • CTField::GetFieldDefaultTimeType()

TOCIndex