The mi_fparam_copy() function

The mi_fparam_copy() function copies an existing MI_FPARAM structure to a newly allocated MI_FPARAM structure field by field.

Syntax

MI_FPARAM *mi_fparam_copy(source_fparam_ptr)
   MI_FPARAM *source_fparam_ptr;
source_fparam_ptr
A pointer to the MI_FPARAM structure to copy.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_fparam_copy() function is a constructor function for the MI_FPARAM structure. It performs the following tasks:
  1. It allocates a new MI_FPARAM structure to hold the copy.
  2. It copies the fields of the source MI_FPARAM structure, which source_fparam_ptr indicates, to the newly allocated MI_FPARAM structure.
  3. It returns a pointer to the newly allocated MI_FPARAM structure.
Server only: The mi_fparam_copy() function allocates a new MI_FPARAM structure in the PER_COMMAND memory duration.

Use the mi_fparam_copy() function when your user-defined routine needs to reuse an MI_FPARAM structure that the database server originally allocated for a particular user-defined routine. You can make any modifications that the DataBlade® API module requires to this new MI_FPARAM structure.

The mi_fparam_copy() function performs a deep copy of every value from the source MI_FPARAM structure to the target MI_FPARAM structure except for the following information:
  • The user-state pointer from the source MI_FPARAM structure is not copied.
  • The row-descriptor pointer from the source MI_FPARAM structure is not copied.

The mi_fparam_copy() function sets a field in the target MI_FPARAM structure to indicate that this MI_FPARAM structure is a user-allocated structure, not one that the database server allocated. In the target MI_FPARAM structure, this field value is independent of its value in the source MI_FPARAM structure. Use the mi_fp_usr_fparam() function to determine the value of this field in an MI_FPARAM structure.

For more information about how to use an MI_FPARAM structure, see the Informix® DataBlade® API Programmer's Guide.

Return values

An MI_FPARAM pointer
A pointer to the newly allocated MI_FPARAM structure, which has the information from the source MI_FPARAM structure.
NULL
The function was not successful.