Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbSetIdentityField

Sets a field to be an identity field starting with specified value and incrementing by a specified amount.

Declaration

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

Description

Sets a field to be an identity field starting with seed value and incrementing by increment.

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

Return Values

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

Example

ctdbSetIdentityField(myTable, "custid", 1, 1);

ctdbAlterTable(mytable, CTDB_ALTER_NORMAL);

See Also

ctdbGetIdentityFieldDetails(), ctdbGetLastIdentity()

TOCIndex