Developer Documentation Library > Data Model > Extending the UNICOM Intelligence Data Model > Creating a CDSC > Implementing the features of a CDSC > Implementing DDL column
 
Implementing DDL column
Append
When the Provider adds a column to the CDSC's VDATA table, it:
Uses the Source.Tables.Item property to get a reference to the VDATA Table object.
Creates a new instance of a Column object and set its properties (at least Type and Name).
Calls Table.Columns.Append to add the new column to the table.
Use the Column object that is passed as a parameter to Columns.Append as a template only. The CDSC should create a new Column object and copy its properties from the Column parameter.
In the C++ skeleton project, call CColumns::InternalAdd to add the new Column object to the collection, and change the CColumns::Append function to return S_OK instead of E_NOTIMPL if it succeeds.
Delete
When the Provider deletes a column in the CDSC's VDATA table, it:
Uses the Source.Tables.Item property to get a reference to the VDATA Table object.
Calls Table.Columns.Delete specifying the index of the column to be deleted.
The index parameter passed to Columns.Delete is a Variant, which contains either the name (in any mixture of upper and lower case) of the column to delete or its numeric position (counting the columns from 0).
When the CDSC deletes a column, it should also delete the data for the column. If the CDSC does not do this, the data will remain in the database and there will be no way to access it.
In the C++ skeleton project, call CColumns::InternalRemove to remove the new Column object from the collection and change the CColumns::Delete function to return S_OK instead of E_NOTIMPL if it succeeds.
See also
Handling hierarchical data
Implementing the features of a CDSC