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
mint ifx_var_flag(var_bin, flag)
var binary **var_bin;
int2 flag;
mint ifx_var_flag(lvar, flag)
lvarchar **lvar;
int2 flag;
- flag
- The int2 value of the allocation flag, either
0
or1
. - var_bin
- The address of the var binary host variable.
- lvar
- The address of the lvarchar pointer host variable.
Usage
- When flag is one, HCL
OneDB™ ESQL/C 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, HCL
OneDB ESQL/C 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, HCL OneDB ESQL/C allocates memory for its data buffer. Whether you allocate memory for the lvarchar or var binary variable, or allow HCL OneDB ESQL/C 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.