IClassSchemaEditEx Interface

Provides access to members that modify an object class schema.

Description

This interface can be used to convert a field of type GUID to type GlobalID or conversely to convert a field of type GlobalID to a field of type GUID.

These methods appy to unversioned ArcSDE feature classes and tables only.

Members

Name Description
Method RegisterGlobalIDColumn Registers this column as an Global ID with the database.
Method UnregisterGlobalIDColumn Unregisters this column as an OID with the database.

IClassSchemaEditEx.RegisterGlobalIDColumn Method

Registers this column as an Global ID with the database.

Public Sub RegisterGlobalIDColumn ( _
    ByVal columnName As String _
)
public void RegisterGlobalIDColumn (
    string columnName
);

Remarks

This method converts a field of type GUID to a field of type GlobalID.

The object must reference an unversioned ArcSDE feature class or table. Use the IVersionedObject3::IsRegisteredAsVersioned property to determine if a dataset is versioned. Additionally the dataset must not be replicated. Use the IWorkspaceReplicasAdmin2::IsReferencedByReplica method to determine if the dataset is part of a replica.

A Global ID field must not already exist on the dataset referenced by the object. Use the IClassEx::HasGlobalID property to determine if a dataset has a Global ID field.

The columnName must reference a field of type GUID in the dataset referenced by the object. The IField::Type property can be used to determine a field type.

There must be no duplicate values in the GUID field. See the DataStatistics coclass for more information.

Another requirement is that the GUID field must be not nullable. See the IField::IsNullable property for more information. By default, GUID columns are nullable. However, when adding a GUID column to a dataset you can specify this field be not nullable. This is possible whether or not the dataset you are adding the new GUID field to already has populated rows. If you add a GUID column to a popluated dataset, and set the IsNullable property of this field to be false, the GUID values will be populated with a default value of {00000000-0000-0000-0000-000000000000}.

If you have a GUID field but it is nullable, to satisfy the requirements of this method, you can simply add a new GUID field, ensure you set the IsNullable property to false, and calculate the values from your GUID field into the newly added GUID field.

Errors will be returned if any of the above requirements are not met.

IClassSchemaEditEx.UnregisterGlobalIDColumn Method

Unregisters this column as an OID with the database.

Public Sub UnregisterGlobalIDColumn ( _
    ByVal columnName As String _
)
public void UnregisterGlobalIDColumn (
    string columnName
);

Errors Returned

-2147212936 - FDO_UNREGISTER_GLOBALID_NOT_SUPPORTED

Cannot unregister a GlobalID field if data is versioned or replicated

Remarks

This method converts a field of type GlobalID to a field of type GUID.

The object must reference an unversioned ArcSDE feature class or table. Use the IVersionedObject3::IsRegisteredAsVersioned property to determine if a dataset is versioned. Additionally the dataset must not be replicated. Use the IWorkspaceReplicasAdmin2::IsReferencedByReplica method to determine if the dataset is part of a replica.

A Global ID field must not already exist on the dataset referenced by the object. Use the IClassEx::HasGlobalID property to determine if a dataset has a Global ID field.

The columnName must reference a field of type GlobalID in the dataset referenced by the object. The IField::Type property can be used to determine a field type.

Errors will be returned if any of the above requirements are not met.

Classes that implement IClassSchemaEditEx

Classes Description
ObjectClass Esri Object Class object.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.