The mi_drop_prepared_statement() function

The mi_drop_prepared_statement() function drops a previously prepared statement.

Syntax

mi_integer mi_drop_prepared_statement(stmt_desc)
   MI_STATEMENT *stmt_desc;
stmt_desc
A pointer to a statement descriptor that references a previously prepared statement.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_drop_prepared_statement() frees the statement descriptor that stmt_desc references. It is the destructor function for a statement descriptor. The mi_prepare() function prepares a statement and returns a statement descriptor for the prepared statement. If a cursor (implicit or explicit) is associated with the prepared statement, mi_drop_prepared_statement() also frees this cursor.
Important: It is recommended that you explicitly free prepared statements with mi_drop_prepared_statement() once you no longer need them. Otherwise, these prepared statements remain until the associated session ends. To clear the cursor associated with a prepared statement instead of freeing the cursor, use the mi_close_statement() function.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful.