IDENTITY Support Added to c-treeDB

Previous Topic

Next Topic

IDENTITY Support Added to c-treeDB

The following functions were added to the c-treeDB C API for working with Identity fields.

ctdbSetIdentityField

Set an Identity field for a table.

CTDBRET ctdbSetIdentityField(CTHANDLE Handle, pTEXT FieldName, CTINT64 seed, CTINT64 increment)

ctdbSetIdentityField() returns CTDBRET_OK on success or a c-tree error code on failure.

Note: You must call ctdbAlterTable() to persist the change to the table after this call.

ctdbGetIdentityFieldDetails

Retrieve the name, seed and increment of an Identity field.

pTEXT ctdbGetIdentityFieldDetails(CTHANDLE Handle, pLONG8 seed, pLONG8 increment)

ctdbGetIdentityFieldDetails() returns the Identity field name or NULL. For a NULL return, use ctdbGetError() to verify if there was an actual error or if there is no identity field defined.

ctdbGetLastIdentity

Retrieve the last Identity value used for a table.

CTDBRET ctdbGetLastIdentity(CTHANDLE Handle, pLONG8 value)

ctdbGetLastIdentity() returns CTDBRET_OK on success or a c-tree error code on failure.

.NET Support