The mi_parameter_type_name() function

The mi_parameter_type_name() function returns the data type name of the column that is associated with a specified input parameter in a prepared statement.

Syntax

mi_string *mi_parameter_type_name(stmt_desc, param_id)
   MI_STATEMENT *stmt_desc;
   mi_integer param_id;
stmt_desc
A pointer to the statement descriptor for the prepared statement that contains the input parameter.
param_id
The parameter identifier of the column, which specifies the position of the input parameter in the specified statement descriptor. Input-parameter numbering follows C programming conventions: the first parameter in the statement is at position zero.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_parameter_type_name() function obtains the data type name of the column that is associated with param_id from the statement descriptor that stmt_desc references. This function is an accessor function for a statement descriptor, which describes a prepared statement. The statement descriptor stores information about the type names of input-parameter columns in the zero-based parameter-type name array. To obtain information about the nth input parameter, use a param_id value of n-1.

Parameter information is available only for the INSERT and UPDATE statements. Support for the UPDATE statement includes the following forms of UPDATE:
  • UPDATE with or without a WHERE clause
  • UPDATE WHERE CURRENT OF

If you attempt to request parameter information for other SQL statements, mi_parameter_type_name() raises an exception.

Return values

An mi_string pointer
The name of the data type of the column that is associated with the specified input parameter.
NULL
The function was not successful.