MI_DATUM mi_qual_constant(MI_AM_QUAL_DESC *qualDesc);
To retrieve the constant value from the argument lists of a qualification function, call mi_qual_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_constant() retrieves the explicit constant argument. For example, mi_qual_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_constant() retrieves the runtime constant value that is associated with the host variable. For example, mi_qual_constant() retrieves the runtime value that replaces the ? in the following function:
WHERE equal(name,? )
To determine if 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_constant() from am_getnext to retrieve the most recent value for the host variable and do not save the value from mi_qual_constant() in user data for subsequent scans.
The MI_DATUM structure contains the value of the constant argument.
See the descriptions of: