The mi_tab_userdata() accessor function

The mi_tab_userdata() function retrieves, from the table descriptor, a pointer to a user-data structure that the access method maintains in shared memory.

Syntax

void* mi_tab_userdata(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the index descriptor.

Usage

During the am_open purpose function, the access method can create and populate a user-data structure in shared memory. The table descriptor user data generally holds state information about the index for use by other purpose functions. To ensure that the user data remains in memory until am_close executes, the access method allocates the memory with a duration of PER_STATEMENT.

To store the pointer in that structure in the table descriptor, am_open calls mi_tab_setuserdata(). Any other purpose function can call mi_tab_userdata() to retrieve the pointer for access to the state information.

Return values

The pointer indicates the location of a user-data structure in shared memory.