The mi_result_command_name() function
The mi_result_command_name() function returns the name of the SQL statement that is the current statement.
Syntax
char *mi_result_command_name(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_result_command_name() function returns the name of 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 function returns the name as a null-terminated string in memory that it has allocated in the current memory duration. This statement name is only the verb of the statement, not the entire statement syntax.
SELECT * FROM customer WHERE state = "CA";
select
: char *cmd_name;
...
cmd_name = mi_result_command_name(conn);
Return values
- An mi_string pointer
- A pointer to the verb of the last statement or command.
- NULL
- The function was not successful.