ESQL/C ifx_var_init() purpose and usage
Answered: amber (hollow confidence) — Paul reasoned by analogy with mi_new_var() that the memory is not initialised and ifx_var_init() is unnecessary; no confirmation from the asker or documentation.
Advisory only.
Posted in 2025
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design
Hello, When are using ESQL/C ifx_var_*() functions to fetch LVARCHAR data dynamically in our Informix driver for Genero BDL. For now we do following to initialize the opaque structure used by this API: void *lvarchar = NULL; ifx_var_flag(&lvarchar, 1); There is this ifx_var_init() we do not use for now. Is this required or is ifx_var_flag() sufficient? Note BTW that the ifx_var_init() function is miss in the ESQL/C documentation. Seb ------------------------------ Sebastien FLAESCH ------------------------------
If it follows the same logic as the mi_new_var() UDR function then the memory is not initialized. IMHO it makes no sense to initialize it as you use mi_set_vardata() and mi_set_varlen() soon after to write something into the location