The mi_fp_getcolid() function

The mi_fp_getcolid() accessor function obtains the column identifier of the column that is associated with the user-defined routine from its MI_FPARAM structure.

Syntax

mi_integer mi_fp_getcolid(fparam_ptr)
   MI_FPARAM *fparam_ptr;
fparam_ptr
A pointer to the associated MI_FPARAM structure.
Valid in client LIBMI application? Valid in user-defined routine?
No Yes

Usage

The mi_fp_getcolid() function obtains the column identifier for the user-defined routine that is associated with the fparam_ptr MI_FPARAM structure. The column identifier is the location of the column within the row structure (with the first column starting at offset 0). The column identifier and row structure identify the column with which the UDR invocation is associated. To obtain the row structure, use the mi_fp_getrow() function.

This function is only valid within an assign(), destroy(), or import support function for an opaque data type that contains smart large objects and for multirepresentational opaque types. Before executing the assign(), destroy(), or import function of an opaque data type, the database server automatically obtains the column identifier and row structure and stores them in the MI_FPARAM structure.

With the mi_fp_getcolid() function, you can implement delayed creation or removal of a smart large object:
  • Delayed creation of a smart large object within the assign() support function

    This function returns the column identifier for the column into which you want to store the opaque type.

  • Delayed removal of a smart large object within the destroy() support function

    This function obtains the column identifier for the column from which you want to remove the opaque type.

Important: The mi_fp_getcolid() function is valid only when called from within an assign(), destroy(), or import support function of an opaque data type. Outside the context of an assign() or destroy() function, mi_fp_getcolid() always returns MI_ERROR.

For more information about UDR information in an MI_FPARAM structure, see the HCL OneDB™ DataBlade® API Programmer's Guide.

Return values

>=0
The column identifier of the column with which the UDR is associated.
MI_ERROR
The function was not successful or that it was not called from within an assign(), destroy(), or import support function of an opaque data type.