6. Defining Function Instances : External Lenspec Routine--Return Result Length of Specified Value
 
Share this page                  
External Lenspec Routine--Return Result Length of Specified Value
The lenspec routine returns the result length for the specified value in the db_length field of the dvr parameter. This routine is called by the DBMS Server when a function instance's fid_rltype field is set to II_RES_EXTERN. Lenspec also returns II_STATUS.
The parameters for the lenspec routine are as follows:
scb
Points to the session control block for error processing.
opid
Points to the operator being invoked.
dv1, dv2
Pointers to II_DATA_VALUE. These pointers specify the inputs to the operator. If the function instance does not use one of the operands, that pointer is zero.
dvr
Pointer to an II_DATA_VALUE whose length is filled in by this routine.
The II_DATA_VALUE parameters are used only to pass type and length information. The db_data field in the II_DATA_VALUE structure must be ignored.
On return from the routine, dvr->db_length must contain a positive value, and the routine should not raise any errors other than 0x22022.