4. Defining Data Types : minmaxdv Routine--Provide Min/Max Values and Lengths
 
Share this page                  
minmaxdv Routine--Provide Min/Max Values and Lengths
The minmaxdv routine provides the minimum and maximum values and lengths for a data type.
Place the address of this routine in the dtd_minmaxdv_addr field of the IIADD_DT_DFN structure. If the II_DT_NOHISTOGRAM attribute is present, then this routine is not necessary.
Depending on the input parameters, the routine returns one or both of the following:
Its minimum and/or maximum value
Its minimum and/or maximum length
The two input parameters are min_dv and max_dv; both are pointers to II_DATA_VALUEs. The lengths specified (db_length) for each may be different, but their data types (db_datatype) must be the same.
The routine uses the following rules to process these inputs:
If an input is NULL, then processing for that input is not performed. This allows the caller who is interested in only the maximum value or only the minimum to use this routine more efficiently.
If the db_length field of an input is supplied as II_LEN_UNKNOWN, no corresponding value is built and placed at the output's db_data field. Instead, the routine returns the valid internal length to the db_length field.
If the db_data field of an input is NULL, then no value is built and placed at the corresponding output's db_data field.
If none of rules 1-3 apply to an input, then the value for the data type and length is built and placed at db_data.