The mi_command_is_finished() function

The mi_command_is_finished() function reports whether the current statement has finished executing.

Syntax

mi_integer mi_command_is_finished(conn)
   MI_CONNECTION *conn;
conn
A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_command_is_finished() function determines whether execution has completed for the current statement on the connection that conn references. The current statement is the most recently executed SQL statement sent to the database server on that connection. The current statement is finished when either of the following conditions occurs:
  • Successful completion

    The database server has executed the statement and the DataBlade® API module has retrieved the last row from any query.

  • Unsuccessful completion

    A database server exception has terminated the statement abnormally.

The current statement must be finished before the database server can process the next statement. Use the mi_query_finish() function to force a statement to finish processing.

Return values

0
The current statement active on the current connection has not completed.
1
The current statement active on the current connection has completed.
MI_ERROR
The function was not successful.