The mi_qual_param_constant() accessor function

The mi_qual_param_constant() function retrieves the constant value for the specified parameter.

Syntax

MI_DATUM mi_qual_param_constant(MI_AM_PARAM_DESC *paramDesc);
paramDesc
Points to the parameter descriptor.

Usage

To retrieve the constant value from the argument lists of a qualification function, call mi_qual_param_constant() from the am_beginscan or am_getnext purpose function.

Qualification functions evaluate the contents of a column against some criteria, such as a supplied constant value.

If a qualification function does not involve a host variable, mi_qual_param_constant() retrieves the explicit constant argument. For example, mi_qual_param_constant() retrieves the string harry from the arguments to the following function:
WHERE equal(name,'harry')
If a qualification function involves a host variable but no explicit value, mi_qual_param_constant() retrieves the runtime constant value that is associated with the host variable. For example, mi_qual_param_constant() retrieves the runtime value that replaces the ? in the following function:
WHERE equal(name,? )
Important: Because the value that an application binds to host variables can change between scans, the results of mi_qual_param_constant() might change between calls to am_getnext.

To determine whether a function involves a host variable argument, execute mi_qual_const_depends_hostvar() in the am_scancost purpose function. If mi_qual_const_depends_hostvar() returns MI_TRUE, call mi_qual_param_constant() from am_getnext to retrieve the most recent value for the host variable and do not save the value from mi_qual_param_constant() in user data for subsequent scans.

Return values

The MI_DATUM structure contains the value of the constant argument.