Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 9 KeyDef : KeyDef Operations : tibasKeyDef_Create()

tibasKeyDef_Create()
Function
Declaration
tibas_status tibasKeyDef_Create(
tibasKeyDef* keyDef,
char*        fieldNames)
Purpose
Creates a primary key and specifies the fields for the key.
Parameters
 
Remarks
Use the tibasKeyDef_Create() function to create a primary key and specify the fields for the key..
The fieldnames parameter specifies a comma separated list of field names to be used as the primary key.
To activate the key definition:
Call the tibasSpaceDef_SetKeyDef() function to assign the KeyDef to a specified SpaceDef so that it can be used as the primary key for searches within the space.
When you call tibasKeyDef() to create a key, the default index type is TIBAS_INDEX_HASH. You can change the index type by calling the tibasKeyDef_SetIndexType() function.

Note also that if you need to change the primary key, you must free the space by calling the tibasSpace_Free() function and then reconnect to the space using the new key definition.
See Also
tibasKeyDef_SetIndexType(), tibasKeyDef_SetFieldNames()

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved