Informix Error -608
-608 Illegal attempt to convert Text/Byte data type.
This statement is written to imply a conversion from a TEXT or BYTE value to another data type, for example, by combining it with other types in an expression or by inserting it into a column of another type. This action is not supported; TEXT and BYTE columns can only be selected or be copied into other columns of the same type. Check that the statement names the columns you intended and that they have the data types you thought.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-608 fires when a statement implies converting a TEXT/BYTE value to a different data type —
per the official guidance, these types can only be selected or copied into a column of the same
type; no other conversion is supported.
- A
TEXT/BYTEcolumn combined with another type in an expression (concatenation, arithmetic, a function expecting a different type), per the official guidance. - A
TEXT/BYTEvalue inserted into a column of a different type, per the official guidance — for instance,INSERT INTO ... SELECT text_column FROM ...targeting aVARCHARcolumn. - A column name mistaken for a different one — per the official guidance's suggested check, confirm the statement actually names the columns intended, with the data types actually expected.
Solutions / Resolution
- Check that the statement names the intended columns and that they have the expected data types, per the official guidance — this error often surfaces a naming mistake rather than a genuine need for BLOB conversion.
- Select or copy
TEXT/BYTEvalues only into columns of the same type, per the official guidance, since that's the only supported operation for these types. - If genuine conversion is needed (extracting text content into a different type), do it at the application level after reading the value out, rather than expecting the server to convert it in SQL.
Examples
The disallowed implicit conversion
INSERT INTO summaries (summary) SELECT content FROM documents WHERE doc_id = 1;
-- -608: content is TEXT, summary is a different (e.g. VARCHAR) type
Corrected — matching types
CREATE TABLE document_copies (content TEXT);
INSERT INTO document_copies (content) SELECT content FROM documents WHERE doc_id = 1;
Diagnostic Checks
- Check the declared types of both sides of the statement — the
TEXT/BYTEsource and whatever it's being combined with or inserted into — to confirm they actually match.
Related Errors / Related Topics
- -609 — "Illegal attempt to use Text/Byte host variable." The same restriction applied to a TEXT/BYTE host variable/locator in embedded SQL, rather than a column reference in plain SQL.
TEXT/BYTE can only move into a column of the same type — check for a column-naming mistake
before assuming genuine conversion is needed.