Routine resolution

If more than one registered UDR has the same routine name, the routine is overloaded. Routine overloading enables several routines to share a name and each of the routines to handle arguments of different data types.

When an SQL statement includes a call to an overloaded routine, the query parser uses routine resolution to determine which of the overloaded routines best handles the data type of the arguments in the routine call of the SQL statement.

To perform routine resolution, the query parser looks up information in the system catalogs based on the routine signature. The routine signature contains the following information:
  • The routine name
  • The number and data types of the arguments
  • Whether the routine is a function or a procedure
The database server combines this information to create an identifier that uniquely identifies the UDR. This routine identifier is in the procid column of the sysprocedures system catalog.
Tip: The DataBlade® API provides the mi_funcid data type to hold routine identifiers. The mi_funcid data type has the same structure as the mi_integer data type. For backward compatibility, some DataBlade API functions (such as mi_routine_id_get()) continue to store an mi_integer for a routine identifier.

For a detailed description of the steps involved in routine resolution, see the Informix® User-Defined Routines and Data Types Developer's Guide.