Uses of MI_DATUM structures
An MI_DATUM structure holds a value that is transferred to or from the database server. DataBlade® API functions handle MI_DATUM structures consistently. The following table lists uses of MI_DATUM structures.
Use of MI_DATUM structures | Description | More information |
---|---|---|
Routine arguments for a UDR | When a UDR is called, the routine manager passes UDR arguments as datums. The data type of each argument determines whether the routine manager passes the argument by reference or by value. | The MI_DATUM arguments |
Return value from a user-defined function | When a user-defined function exits, the routine manager passes the return value as a datum. The return-value data type determines whether the routine manager passes the return value by reference or by value. | Return a value |
OUT parameter from a user-defined function | When a user-defined function sets an OUT parameter, the routine manager passes the parameter back as a datum. The routine manager always passes an OUT parameter by reference. | An OUT parameter |
Routine arguments for a UDR that you execute with the Fastpath interface | When you execute a UDR with the Fastpath interface, the mi_routine_exec() function passes UDR arguments as datums. The data type of each argument determines whether this function passes the argument by reference or by value. | Pass in argument values |
Return value from a UDR that you execute with the Fastpath interface | When a user-defined function that you execute with the Fastpath interface returns, the mi_routine_exec() function passes the return value as a datum. The return-value data type determines whether this function passes the return value by reference or by value. | Receive the return value |
Column values returned or inserted in SQL statements | When the mi_value() or mi_value_by_name() function
returns a column value for a query in binary representation, it returns
this value as a datum. When the mi_row_create() function creates a row structure, it accepts column values as datums. |
Obtain column values |
Element values retrieved or inserted in SQL collections | When the mi_collection_fetch() function
fetches an element from a collection, it represents the element as
a datum. When the mi_collection_insert() function inserts an element from a collection, it represents the element as a datum. |
Access the elements of a collection |
Input-parameter values in a prepared SQL statement | When the mi_exec_prepared_statement() or mi_open_prepared_statement() function provides input-parameter values, it represents them as datums. | Assign values to input parameters |