Drop a prepared statement

A statement descriptor describes a prepared statement. However, this DataBlade® API structure is not allocated from the memory-duration pools. Instead, its scope is from the time it is created with mi_prepare() until whichever of the following events occurs first:
  • The mi_drop_prepared_statement() function frees the statement descriptor.
  • The mi_close() function closes the connection.
  • The SQL statement that invoked the C UDR ends. (Server only)

To conserve resources, use the mi_drop_prepared_statement() function to explicitly deallocate the statement descriptor once your DataBlade API module no longer needs it. The mi_drop_prepared_statement() function is the destructor function for a statement descriptor. It frees the statement descriptor and any resources (such as an implicit or explicit cursor) that are associated with the statement descriptor. These resources include the prepared statement and any associated row cursor. After you drop a prepared statement, you must re-prepare it before it can be executed again.