Select into a fixed-size lvarchar host variable

To select data from an opaque type column into a fixed-size lvarchar host variable, the code fragment in Accessing the external format of the circle opaque data type takes the following steps:
  1. Selects the data that the circle_col opaque-type column contains into the lv_circle host variable.

    When the database server executes the SELECT statement, it calls the output support function for the circle data type (circle_out) to translate the internal format that it retrieved from disk to the external format that the Informix® ESQL/C application requests. This SELECT statement also uses a user-defined function called radius (see Registering the circle opaque data type) to extract the radius value from the opaque-type column. This function must be registered with the database server for this SELECT statement to execute successfully.

  2. Accesses the circle data from the lvarchar host variable.

    After the SELECT statement, the lv_circle host variable contains data in the external format of the circle data type.

When you select a null value from an opaque-type column into an lvarchar host variable, Informix ESQL/C sets any accompanying indicator variable to -1.