Informix Error -609
-609 Illegal attempt to use Text/Byte host variable.
This statement uses a host variable that is a TEXT or BYTE locator structure but combines it with data of some other type (for instance, in an expression or by inserting it into a column of another type). This action is not supported; host variables of these types may only be used for selecting from, creating, or inserting into columns of the same type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-609 is the embedded-SQL/host-variable analog of -608: it fires when a TEXT/BYTE locator
host variable is combined with data of a different type — per the official guidance, these host
variables may only be used for selecting from, creating, or inserting into columns of the same
type.
- A
TEXT/BYTElocator host variable combined in an expression with a different type, per the official guidance. - A
TEXT/BYTElocator host variable inserted into a column of a different type, per the official guidance. - The wrong host variable passed to a placeholder — a locator variable meant for a different statement/column accidentally reused where a different type was expected.
Solutions / Resolution
- Use the
TEXT/BYTElocator host variable only for selecting from, creating, or inserting into columns of the same type, per the official guidance — that's the only supported usage. - Review which host variable is bound to which placeholder, confirming a locator variable is
only ever paired with a
TEXT/BYTEcolumn, and other host variables handle other columns. - If genuine data transformation is needed, read the BLOB content out via the locator first, transform it at the application level, then write the result to its actual target type separately.
Examples
The disallowed combination
loc_t content_locator;
/* content_locator is a TEXT/BYTE locator */
EXEC SQL INSERT INTO summaries (summary) VALUES (:content_locator);
/* -609: summary is a different (e.g. VARCHAR) type */
Corrected — matching types
loc_t content_locator;
EXEC SQL INSERT INTO document_copies (content) VALUES (:content_locator);
/* content_copies.content is TEXT, matching the locator's type */
Diagnostic Checks
- Check the declared type of the column each host variable is bound to, confirming a
TEXT/BYTElocator is only ever paired with aTEXT/BYTEcolumn.
Related Errors / Related Topics
- -608 — "Illegal attempt to convert Text/Byte data type." The same restriction expressed in plain SQL against a column reference, rather than a host variable in embedded SQL.
The embedded-SQL analog of -608 — a TEXT/BYTE locator host variable can only pair with a
column of the same type.