The ifx_var_getlen() function

The ifx_var_getlen() function returns the length of the data in an lvarchar pointer or var binary host variable.

Syntax

var binary
mint ifx_var_getlen(var_bin)
   var binary **var_bin;
lvarchar
mint ifx_var_getlen(lvar)
   lvarchar **lvar;
var_bin
The address of the var binary host variable whose length is returned.
lvar
The address of the lvarchar pointer host variable whose length is returned.

Usage

The length that the ifx_var_getlen() function returns is the number of bytes that have been allocated for the data buffer of the lvar or var_bin host variable.

If you get an lvarchar pointer or var binary from a descriptor area by using the DATA clause of a GET DESCRIPTOR statement, the value is null terminated. If you use ifx_var_getlen() on such a variable, the length returned includes the null terminator. To get the correct length use the LENGTH clause of the GET DESCRIPTOR statement.

Return codes

>=0
The length of the data buffer for the var_bin host variable.
<0
The function was not successful.