The mi_tab_spacename() accessor function

The mi_tab_spacename() function retrieves the name of the storage space where the virtual table resides.

Syntax

mi_string* mi_tab_spacename(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the table 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 a table, the CREATE TABLE 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 TABLE remote...
   IN dc39
   USING access_method 
The statement that creates the table 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 TABLE remote...
   IN '/tmp'
   USING access_method

If the IN clause specifies multiple storage spaces, each makes up a fragment of the table 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 tables. The database server assigns the default sbspace to a virtual table under the following circumstances:
  • A CREATE TABLE 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 TABLE statement associates with the table. A NULL-valued pointer indicates that the table does not reside in a named storage space.