informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_current_command_name()

The mi_current_command_name() function returns the name of the SQL statement that invoked the C UDR.

Syntax

Usage

The mi_current_command_name() function returns the name as a null-terminated string in memory that it allocates in the current memory duration. This statement name is only the verb of the statement, not the entire statement syntax.

For example, suppose the following statement executes:

The mi_current_command_name() function returns only the verb of this statement: delete.

The conn parameter is redundant when you call mi_current_command_name() within the context of a user-defined routine. This function is useful in user-defined routines that need to know what kind of SQL statement caused them to be invoked.

Important: You can use the mi_current_command_name() function to obtain the SQL statement that invoked a C UDR. The mi_result_command_name() function returns the name of the current statement. You can obtain the name of a prepared statement with the mi_statement_command() function.

Return Values

mi_string * is a pointer to the verb of the last statement or command.
NULL indicates that the function was not successful or no current statement exists.

Related Topics

See the description of the following functions: mi_get_result(), mi_result_command_name(), and mi_statement_command().


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved