4. Defining Data Types : dbtoev Routine—Determine External Data Type
 
Share this page                  
dbtoev Routine—Determine External Data Type
The dbtoev routine determines the external data type to which a user-defined data type is converted.
This routine returns the external type specification for the input data type. A coercion (function instance) must be defined to convert the input data type to the given output data type and length.
This routine is called by the DBMS Server to determine how to pass a non-exportable data type to an Ingres tool as the result of a select or fetch statement. This routine sets the ev_value field to the external data type and length for the specified user-defined data type. You must place the address of this routine in the dtd_dbtoev_addr field of the IIADD_DT_DFN structure.
The output data type (db_datatype) must be an SQL data type. Valid values are:
II_INTEGER
II_DECIMAL
II_FLOAT
II_C
II_CHAR
II_VARCHAR
II_TEXT
The copy SQL statement does not use this interface. User-defined (and other non-exportable) data types are returned in their original state, as char data of the appropriate length.