The ifx_var_flag() function

The ifx_var_flag() function determines how memory is allocated for the data buffer of an lvarchar or var binary host variable.

Syntax

var binary
mint ifx_var_flag(var_bin, flag)
   var binary **var_bin;
   int2 flag;
lvarchar
mint ifx_var_flag(lvar, flag)
   lvarchar **lvar;
   int2 flag;
flag
The int2 value of the allocation flag, either 0 or 1.
var_bin
The address of the var binary host variable.
lvar
The address of the lvarchar pointer host variable.

Usage

The value of the flag argument is the allocation flag. It determines who handles memory allocation for the data of the var_bin host variable, as follows:
  • When flag is one, automatically performs this memory allocation.

    You can use a flag value of 1 before a SELECT statement when you are unsure of the amount of data that the SELECT returns.

  • When flag is zero, does not automatically perform this memory allocation.

    When you set flag to 0, you must allocate memory for the data buffer of the lvar or var_bin variable with the ifx_var_alloc() functions.

If you do not call the ifx_var_flag() function for an lvarchar or var binary host variable, allocates memory for its data buffer. Whether you allocate memory for the lvarchar or var binary variable, or allow to do it for you, you must free the memory with the ifx_var_dealloc() function.

Return codes

0
The function was successful.
<0
The function was not successful and the return value indicates the cause of the error.