The mi_routine_end() function

The mi_routine_end() function releases resources associated with a function descriptor.

Syntax

mi_integer mi_routine_end(conn, funcdesc_ptr)
   MI_CONNECTION *conn;
   MI_FUNC_DESC *funcdesc_ptr;
conn
A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().

This value can be a pointer to a session-duration connection descriptor established by a previous call to mi_get_session_connection(). Use of a session-duration connection descriptor is an advanced feature of the DataBlade® API.

funcdesc_ptr
A pointer to the function descriptor to deallocate.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_routine_end() function frees the function descriptor that funcdesc_ptr references. This function is the destructor function for the function descriptor. It frees the memory for the MI_FPARAM structure that is stored in the function descriptor and for the function descriptor itself.
Important: It is recommended that you explicitly deallocate function descriptors with mi_routine_end() once you no longer need them. Otherwise, these function descriptors remain until the end of the associated SQL command.

The mi_routine_end() function is one of the functions of the Fastpath interface.

Server only: The mi_routine_end() function is also the destructor function for the session-duration function descriptor. It frees memory for the session-duration function descriptor (including its MI_FPARAM structure). However, you must explicitly free any PER_SESSION named memory that holds the function descriptor.

Session-duration function descriptors and named memory are advanced features of the DataBlade API. They can adversely affect your UDR if you use them incorrectly. Use them only when a regular function descriptor cannot perform the task you need done. For more information, see the HCL OneDB™ DataBlade API Programmer's Guide.

Return values

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