The am_create purpose function

The database server calls am_create to process a CREATE INDEX statement. The am_create function creates the index, based on the information in the table descriptor, which describes the keys in an index.

Syntax

mi_integer am_create(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the index descriptor.

Usage

Even if the access method does not provide an am_create function, the database server automatically adds the created object to the system catalog tables, such as systables or sysindices. For example, a user might issue the CREATE TABLE command to register an existing index in another database of the same database server instance.

The am_create function typically:
  • Calls accessor functions to extract table specifications from the table descriptor, including a pointer to the row descriptor
  • Calls DataBlade® API functions to extract column attributes from the row descriptor
  • Verifies that the access method can provide all the requirements that the CREATE INDEX specifies
  • Validates CREATE INDEX statements that specify identical keys
  • Calls the appropriate DataBlade API functions to create a smart large object or interact with the operating system for file creation, as described in Manage storage spaces
  • Executes support functions that build the index

    The access method might supply the support functions or execute UDRs from outside the access-method shared-object library.

Important: By default, transaction logging is disabled in sbspaces. To find out how to turn logging on, see Ensure data integrity.

Return values

MI_OK
Indicates success.
MI_ERROR
Indicates failure.

Related topics

In the Informix® DataBlade API Programmer's Guide, see the descriptions of:
  • DataBlade API functions, such as mi_lo_create(), and create-time constants
  • DataBlade API accessor functions for the row descriptor