The mi_func_desc_by_typeid() function
The mi_func_desc_by_typeid() function looks up a registered user-defined routine by its routine identifier and creates its function descriptor.
Syntax
MI_FUNC_DESC *mi_func_desc_by_typeid(conn, routine_id)
MI_CONNECTION *conn;
mi_funcid *routine_id;;
- conn
- A pointer to a connection descriptor established by a previous
call to mi_open(), mi_server_connect(),
or mi_server_reconnect().
This value can be a pointer to a session-duration connection descriptor established by a previous call to mi_get_session_connection(). Use of a session-duration connection descriptor is an advanced feature of the DataBlade® API.
- routine_id
- The routine identifier that uniquely identifies the UDR within the sysprocedures system catalog table.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
- Looks for a user-defined routine that matches the routine_id routine identifier in the sysprocedures system catalog table
- Allocates a function descriptor for the UDR and saves the routine sequence in this descriptor
- Allocates an MI_FPARAM structure for the routine and saves the argument and return-value information in this structure
- Returns a pointer to the function descriptor that it has allocated for the user-defined routine
The session-duration connection descriptor and session-duration function descriptor are advanced features of the DataBlade API. They can adversely affect your UDR if you use them incorrectly. Use them only when a regular connection descriptor or function descriptor cannot perform the task you need done.
Return values
- An MI_FUNC_DESC pointer
- A pointer to the function descriptor for the UDR that routine_id identifies.
- NULL
- No matching user-defined routine was found or that the specified
user-defined routine has multiple return values, which is possible
with the following routines:
- SPL routines that include the WITH RESUME clause in the RETURN statement
- Iterator functions