Space Definition Through the API

By calling the SpaceDef functions or methods provided in the ActiveSpaces API you can specify the basic attributes and policies for a space.

Using the SpaceDef Object

In the Java API, defining a space is done using the defineSpace method of the Metaspace object, which takes a SpaceDefinition object as its sole parameter. In the C API, you define a space by calling the tibasSpaceDef_Create() function.

If the space was already defined in the metaspace, then defineSpace compares the space definition that was passed to it as an argument with the space definition currently stored in the metaspace; if the definitions match then defineSpace returns successfully, otherwise an error is thrown.

Using the Admin Object Execute Method

A space can also be defined through the API by using the admin object’s execute method to execute a define Space admin language command.

Example creating a space using the admin language:

define space name 'myspace' (field name 'key' type 'integer', field name 'value' type 'string') key ('key')
Note: Space names are case-sensitive.