ifx_var_alloc()
Allocates memory for the data buffer.
ifx_var_dealloc()
Deallocates memory for the data buffer.
ifx_var_flag()
Determines whether ESQL/C or the application handles memory allocation for the data buffer.
ifx_var_getdata()
Returns the contents of the data buffer.
ifx_var_getlen()
Returns the length of the data buffer.
ifx_var_isnull()
Checks whether the data in the data buffer is null.
ifx_var_setdata()
Sets the data for the data buffer.
ifx_var_setlen()
Sets the length of the data buffer.
ifx_var_setnull()
Sets the data in the data buffer to a null value.
These lvarchar pointer and var binary functions are defined in the sqlhdr.h header file so you do not need to include a special header file in your ESQL/C programs that use them. The following pages describe each of these functions. ifx_var_alloc() The ifx_var_alloc() function allocates memory for the data buffer of an lvarchar or var binary host variable. Syntax var binary
var_bin
is the address of the var binary pointer host variable whose data buffer is allocated.
lvar
is the address of the lvarchar pointer host variable whose data buffer is allocated.
var_size
is the size, in bytes, of the data buffer to allocate.
0
The function was successful.
<0
The function was not successful and the return value indicates the cause of the error.
is the address of the var binary pointer host variable whose data buffer is deallocated.
1
flag
is the integer value of the allocation flag, either 0 or 1.
is the address of the var binary host variable.
is the address of the lvarchar pointer host variable.
is the address of the var binary host variable whose data is retrieved.
is the address of the lvarchar pointer host variable whose data is retrieved.
Null pointer
The function was not successful.
Valid pointer to the data buffer
is the address of the var binary host variable whose length is returned.
is the address of the lvarchar pointer host variable whose length is returned.
>=0
The length of the data buffer for the var_bin host variable.
Return Codes
The opaque-type data is not a null value.
The opaque-type data is a null value.
buffer
is a character buffer that contains the data to store in the lvar or var_bin host variable.
buf_len
is the length, in bytes, of the buffer.
length
is the length, in bytes, of the data buffer to allocate for the var binary data.
is the value 0 to indicate a non-null value or 1 to indicate a null value.