Was this helpful?
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.
Inputs
The inputs for this function are:
scb
Pointer to an SCB
db_value
Ptr to II_DATA_VALUE for database type
ev_value
Ptr to II_DATA_VALUE for export type
Outputs
The outputs for this function are:
*ev_value
Filled in as follows:
db_datatype
Type of export value. See the description for a list of valid values for this field.
db_length
Length of export value
db_prec
Must be 0
Returns
II_STATUS
Last modified date: 04/03/2024