Insert from a fixed binary host variable
- Includes the definition of the internal structure of the circle opaque
data type.
The definition of the circle_t internal data structure, which Figure 1 shows, must be available to your IBM® Informix® ESQL/C program. Therefore, the code fragment includes the circle.h header file, which contains the definition of the circle_t structure.
- Stores the data for the fixed binary host variable into
the internal data structure, circle_t.
The declaration of the fixed binary host variable associates the circle_t internal data structure with the fbin_circle host variable. The code fragment assigns a value to each member of the circle_t data structure.
- Inserts the data that the fbin_circle host variable contains
into the circle_col opaque-type column.
When the database server executes the INSERT statement, it calls the receive support function for the circle data type (circle_rcv) to perform any translation necessary between the internal format of the data that the Informix ESQL/C client application has sent (circle_t) and the internal format of the circle data type on disk.
#include <circle.h>;
EXEC SQL BEGIN DECLARE SECTION;
fixed binary 'circle' circle_t fbin_circle;
int circle_ind;
EXEC SQL END DECLARE SECTION;
⋮
circle_ind = -1;
EXEC SQL insert into circle_tab
values (:fbin_circle:circle_ind);