Home | Previous Page | Next Page   Purpose-Function Reference > Purpose-Function Syntax >

am_insert

The database server calls am_insert for:

Syntax

mi_integer am_insert(MI_AM_TABLE_DESC *tableDesc, 
        MI_ROW *row, 
        MI_AM_ROWID_DESC *ridDesc)
tableDesc
points to the index descriptor.
row
points to a row structure in shared memory that contains the values for the access method to insert.
ridDesc
points to the row-ID descriptor, which contains the row identifier and fragment identifier for the new row that corresponds to the new index entry.

Usage

If row and ridDesc are 0, am_insert calls mi_tab_niorows() to determine the maximum number of new index entries to expect. For each entry up to the maximum number passed, the am_insert function calls mi_tab_nextrow(). For a complete example, see mi_tab_nextrow().

Possible row identifiers include:

For each new entry, am_insert:

To manipulate the index structure, am_insert executes support functions, either with a call to an access-method function or with the DataBlade API FastPath facility. For more information, refer to Using FastPath. Call mi_tab_userdata() to retrieve the pointer to PER_STATEMENT user data. Call mi_routine_exec() to execute the support function.

Important:
The database server does not call am_insert unless the am_readwrite purpose flag is set. If you do not set the am_rowids purpose flag, the database server ignores any row identifier that the access method provides. For more information about setting purpose flags, refer to SQL Statements for Access Methods.

Warning:
If the access method does not supply am_insert, but an SQL statement requires it, the database server raises an error. For more information on how to handle this error, refer to Supplying Error Messages and a User Guide.

Return Values

MI_OK indicates success. MI_ERROR indicates failure.

Related Topics

See the descriptions of:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]