Informix Error -24123: Blobs are not allowed in the "Union" clause.
Cause and resolution
Blobs are not allowed in the "Union" clause.
You selected a TEXT or BYTE column in a UNION query. The SELECT clause of each query cannot include any TEXT or BYTE columns. These columns are not allowed in a UNION clause because TEXT and BYTE columns cannot be tested for equality. A UNION ALL clause, however, can include TEXT and BYTE columns (in a standalone SELECT statement or in a UNION view).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-24123 fires when a UNION query's SELECT clause includes a TEXT or BYTE
column — per the official guidance, these types can't be tested for equality, which UNION
requires (to eliminate duplicate rows); UNION ALL doesn't have this restriction since it
keeps duplicates.
- A
TEXT/BYTEcolumn selected within aUNIONquery, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use
UNION ALLinstead ofUNION, per the official guidance, if theTEXT/BYTEcolumn and duplicate rows are both acceptable, or - Remove the
TEXT/BYTEcolumn from theSELECTlist, per the official guidance, if plainUNIONsemantics are required.
Examples
A TEXT column in a UNION
SELECT id, notes FROM orders
UNION
SELECT id, notes FROM archived_orders;
-- -24123: notes is TEXT, not allowed in UNION
Corrected — using UNION ALL
SELECT id, notes FROM orders
UNION ALL
SELECT id, notes FROM archived_orders;
Diagnostic Checks
- Check every
SELECTin theUNIONforTEXT/BYTEcolumns, and switch toUNION ALLor drop the column.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -24123 in this set yet.
A UNION query selected a TEXT/BYTE column, which can't be tested for equality — use
UNION ALL or drop the column.