|
The mi_statement_command_name() function returns the name of an SQL prepared statement.
The mi_statement_command_name() function returns the SQL statement name in the prepared statement that stmt_desc references. The function returns the name as a null-terminated string in memory that it allocated in the current memory duration. This statement name is only the verb of the statement, not the entire statement syntax.
For example, suppose the mi_prepare() statement had prepared the following SELECT statement:
The mi_statement_command_name() returns only the verb of this statement: select.
Important: Use the mi_statement_command_name() function only for prepared statements. To obtain the name of the current statement, use the mi_result_command_name() function after the mi_get_result() function returns MI_DML or MI_DDL. To obtain the name of the SQL statement that has invoked a C UDR, use the mi_current_command_name() function.
The function returns the statement verb as a null-terminated string in a buffer that it allocates.
mi_string * | is a pointer to the verb of the last statement or command. |
NULL | indicates that the function was not successful. |
See the descriptions of the following functions: mi_current_command_name(), mi_get_result(), mi_prepare(), and mi_result_command_name().