ESQL/C host variables as field values
You can use the Informix® ESQL/C host variable to specify a field value for a row variable.
The host variable must be declared with a data type that
is compatible with the data type of the field and must contain a value
that is also compatible. For example, the following UPDATE statement
uses a host variable to update a single value into the a_row variable.
an_int = 6;
EXEC SQL update table(:a_row) set fld1 = :an_int;
To insert multiple values into a row variable,
you can use an UPDATE statement for each value or you can specify
all field values in a single UPDATE statement:
one_fld = 469;
second_fld = 'dog';
EXEC SQL update table(:a_row)
set fld1 = :one_fld, fld2 = :second_fld;
The following variation of the UPDATE statement performs
the same task as the preceding UPDATE statement:
EXEC SQL update table(:a_row) set (fld1, fld2) =
(:one_fld, :second_fld);
The following UPDATE statement updates the nested_row variable
with a literal field value and a host variable:
EXEC SQL update table(:nested_row)
set b = row(7, :i);