Pass in argument values

When you call mi_routine_exec(), you provide argument values for the UDR that Fastpath is to execute.

Keep the following points in mind when you create the argument list for mi_routine_exec():
  • If an argument has a default value, you do not need to include its argument value in this argument list.
  • You must pass in the arguments as MI_DATUM values.

    Therefore, you must pass in the arguments with the appropriate passing mechanism for the data type. Most data types are to be passed by reference to the UDR. For a list of data types that can be passed by value, see Types of values that fit in an MI_DATUM structure (Passed by value). For examples of how to pass arguments to a UDR through mi_routine_exec(), see Sample mi_routine_exec() calls.

  • If the UDR can handle NULL arguments, pass a NULL-valued pointer as an argument to mi_routine_end(), as the code fragment in Determine if a UDR handles NULL arguments shows.

    If you call a UDR that does not handle NULLs with a NULL argument value, the routine might return incorrect values.

  • If you allocate your own MI_FPARAM structure, pass in a pointer to this structure as the last argument in the argument list.

    For more information, see A user-allocated MI_FPARAM structure.

The mi_routine_exec() function dispatches the UDR through the routine manager. Therefore, each UDR gets a call to mi_call() because the routine manager checks for sufficient space before it executes the UDR.