Input support function
The database server calls the input function when it receives the external representation of an opaque type from a client application. For example, when a client application issues an INSERT or UPDATE statement, it can send the text representation of an opaque type to the database server to be stored in an opaque-type column. The database server calls the input function to convert this external representation to an internal representation that it stores on disk.
- Allocate enough space to hold the internal representation.
The function can use the mi_alloc() DataBlade® API function to allocate the space for the internal structure.
- Parse the input string.
It must obtain the individual members from the input string and store them in the appropriate fields of the internal structure
- Return a pointer to the internal structure.
If the opaque data type is pass by value, the input support function should perform these same basic tasks but return the actual value in the internal structure instead of a pointer to this structure. You can use pass by value only for opaque types that are less than 4 bytes in length.
ll_longlong_t * ll_longlong_input(mi_lvarchar *extrnl_format);
The ll_longlong_input() function is a cast function from the LVARCHAR data type to the ll_longlong_t internal structure. It must be registered as an implicit cast function with the CREATE IMPLICIT CAST statement. For more information about cast functions, see Create casts for opaque data types.