Home | Previous Page | Next Page   Function Descriptions >

mi_parameter_count( )

The mi_parameter_count( ) function returns the number of input parameters in a prepared statement.

Syntax

mi_integer mi_parameter_count(stmt_desc)
   MI_STATEMENT *stmt_desc;
stmt_desc
is a pointer to the statement descriptor for a prepared statement.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

The mi_parameter_count( ) function obtains the number of input parameters in the statement descriptor that stmt_desc references. A statement descriptor describes a prepared statement. You can use the mi_parameter_count( ) function with the DataBlade API functions that obtain information about each input parameter of the prepared statement (such as mi_parameter_type_id( ) and mi_parameter_nullable( )).

Parameter information is available only for the INSERT and UPDATE statements. Support for the UPDATE statement includes the following forms of UPDATE:

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

Return Values

>=0
is the number of input parameters contained in the text of the prepared statement.
MI_ERROR
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_close_statement( ), mi_exec_prepared_statement( ), mi_fetch_statement( ), mi_parameter_nullable( ), mi_parameter_precision( ), mi_parameter_scale( ), mi_parameter_type_id( ), mi_parameter_type_name( ), and mi_prepare( ).

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]