The mi_tab_spacename() accessor function

The mi_tab_spacename() function retrieves the name of the storage space where the virtual index is.

Syntax

mi_string* mi_tab_spacename(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the index descriptor.

Usage

Call the mi_tab_spacename() function to determine the storage space identifier from one of the following sources:
  • An IN clause specification
  • The SBSPACENAME value in the database onconfig file

IN clause

When a user creates an index, the CREATE INDEX statement can include an IN clause that specifies one of the following:
  • The name that is assigned with the onspaces utility
  • A string that contains the actual location
For example, the mi_tab_spacename() function returns the string dc39 for a storage space that the following commands specify:
onspaces -c -x dc39 -l "host=dcserver,port=39"
CREATE INDEX idx_remote on TABLE remote...
   IN dc39
   USING access_method 
The statement that creates the index can specify the physical storage location rather than a logical name that the onspaces utility associates with the storage space. In the following UNIX™ example, mi_tab_spacename() returns the physical path, /tmp:
CREATE INDEX idx_remote on TABLE remote...
   IN '/tmp'
   USING access_method

If the IN clause specifies multiple storage spaces, each makes up a fragment of the index and the table descriptor pertains to only the fragment that the return value for the mi_tab_spacename() function names.

SBSPACENAME value

An optional SBSPACENAME parameter in the onconfig file indicates the name of an existing sbspace as the default location to create new smart large objects or virtual indexes. The database server assigns the default sbspace to a virtual index under the following circumstances:
  • A CREATE INDEX statement does not include an IN clause.
  • The database server determines (from the am_sptype purpose value in the sysams system catalog table) that the access method supports sbspaces.
  • The onconfig file contains a value for the SBSPACENAME parameter.
  • The onspaces command created an sbspace with the name that SBSPACENAME specifies.
  • The default sbspace does not contain a table due to a previous SQL statement.

Return values

A string identifies the sbspace or extspace that the CREATE INDEX statement associates with the index. A NULL-valued pointer indicates that the index is not in a named storage space.