informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_routine_get_by_typeid()

The mi_routine_get_by_typeid() function looks up a registered user-defined routine by a routine signature that it builds from a list of arguments and returns its function descriptor.

Syntax

Usage

The mi_routine_get_by_typeid() function creates a function descriptor for the UDR that the routine signature specifies. The function builds the routine signature from the udr_type, udr_name, owner, arg_count, and arg_types arguments. The mi_routine_get_by_typeid() function is one of the functions of the Fastpath interface. It is a constructor function for the function descriptor and

The mi_routine_get_by_typeid() function performs the following tasks:

  1. Looks for a user-defined routine that matches the routine signature in the sysprocedures system catalog table.
  2. Allocates a function descriptor for the routine and saves the routine sequence in this descriptor.
  3. Allocates an MI_FPARAM structure for the routine and saves the argument and return-value information in this structure.
  4. Returns a pointer to the function descriptor that it allocated for the user-defined routine.

The mi_routine_get_by_typeid() function allocates a new function descriptor in the PER_COMMAND memory duration.

When the UDR is defined in a database that is not ANSI-compliant, mi_routine_get_by_typeid() looks for UDRs owned only by owner. If you specify a NULL-valued pointer as an owner, mi_routine_get_by_typeid() looks for UDRs owned by anyone. The following call to mi_routine_get_by_typeid() looks for the a_proc() user-defined procedure in a database that is not ANSI compliant:



When the UDR is defined in an ANSI-complaint database, owner is part of its routine signature. You can specify a particular owner name to obtain UDRs of a particular owner. If you specify a NULL-valued pointer as an owner, mi_routine_get_by_typeid() assumes the current user account as the owner name. If no UDRs exist for the current user, mi_routine_get_by_typeid() looks for UDRs with user informix as the owner name.

If a_proc() was defined in an ANSI-compliant database, the following call to mi_routine_get_by_typeid() looks up the a_proc() user-defined procedure owned by user dexter:

Return Values

MI_FUNC_DESC * is a pointer to the function descriptor of the routine that rout_sig specifies.
NULL indicates that no matching user-defined routine was found or that the specified user-defined routine has multiple return values, which is possible with:

Other internal errors raise an exception.

Related Topics

See the descriptions of the following functions: mi_fparam_get(), mi_routine_get(), mi_routine_exec(), mi_routine_end(), and mi_td_cast_get().

For more information, see Calling UDRs with the Fastpath Interface.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved