Home | Previous Page | Next Page   Writing Support Functions > Handling the External Representation >

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.

Figure 11 shows when the database server executes the input support function.

Figure 11. Execution of the Input Support Function
begin figure description - This figure is described in the surrounding text. - end figure description

If the opaque data type is pass by reference, the input support function should perform the following tasks:

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.

C Language Support

The input function takes an mi_lvarchar value as an argument and returns the internal structure for the opaque type. The following function signature is an input support function for a fixed-length opaque data type whose internal structure is ll_longlong_t:

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 on cast functions, see Creating Casts for Opaque Data Types.

End of C Language Support
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]