The am_close purpose function

The database server calls am_close when the processing of a single SQL statement (SELECT, UPDATE, INSERT, DELETE, MERGE) completes.

Syntax

mi_integer am_close(MI_AM_TABLE_DESC *tableDesc)
tableDesc
Points to the table descriptor.

Usage

The am_close function might:
  • Deallocate user-data memory that am_open allocated with a PER_STMT_EXEC or PER_STMT_PREP duration
  • Call mi_file_close(), mi_lo_close(), or one of the DataBlade® API functions that copies smart-large-object data to a file
Restriction: Do not call the DataBlade API mi_close() function to free a database connection handle that you open (in the am_open purpose function) with mi_open(). Because the database connection has a PER_COMMAND duration not a PER_STATEMENT duration, the database server frees the handle before it calls the am_close purpose function.

Return values

MI_OK
Indicates success.
MI_ERROR
Indicates failure.

Related topics

  • DataBlade API functions, such as mi_file_close() or mi_lo_close(), in the Informix® DataBlade API Programmer's Guide