Informix Error -236
-236 Number of columns in INSERT does not match number of VALUES.
Each column that is named or implied in an INSERT statement must have a separate value expression. If the statement does not list specific columns, review the definition of the table for the number of columns and their data types. Also check that the list of expressions in the VALUES clause has no extra or missing comma that might result in an incorrect number of values. Be especially careful of long character strings and expressions with parentheses.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-236 is a common, everyday mismatch between the number of columns an INSERT targets and the
number of value expressions provided.
- An explicit column list with a mismatched number of values — the straightforward case.
- An
INSERTwithout an explicit column list (implying every column in the table) where the number of values doesn't match the table's actual column count — especially prone to breaking silently after a schema change, since there's no explicit list to check against. - A missing or extra comma in the
VALUESclause, producing a different actual count of expressions than intended. - Long character strings or expressions with parentheses obscuring a missing or extra comma visually — the official text specifically flags this as a common source of confusion, since a comma buried inside or after a long literal is easy to miss on a read-through.
- A schema change since the statement was written — an
ALTER TABLE ADD COLUMNon a table targeted by an implicit-columnINSERTnow needs one more value than before.
Solutions / Resolution
- Count exactly how many values are needed against the column list (explicit or implied), per the official guidance.
- Check the
VALUESclause carefully for a missing or extra comma — pay particular attention around long strings and parenthesized expressions, where a comma error is easy to overlook at a glance. - If a schema change altered the table's column count, either add an explicit column list to
the
INSERT(a good practice generally) or add/remove the corresponding value to match. - Prefer always using an explicit column list in
INSERTstatements rather than relying on implicit column-order matching — this makes intent clear and insulates the statement from future schema changes that add columns.
Examples
A missing comma hidden by a long string
INSERT INTO customer (id, name, notes) VALUES
(1, 'Jane Doe' 'Called about invoice #4521 on 2026-09-15 regarding a billing discrepancy');
-- -236: missing comma between 'Jane Doe' and the notes string —
-- easy to miss with two adjacent long string literals
Fix:
INSERT INTO customer (id, name, notes) VALUES
(1, 'Jane Doe', 'Called about invoice #4521 on 2026-09-15 regarding a billing discrepancy');
A schema change breaking an implicit-column INSERT
-- Table originally had 3 columns; this INSERT relied on implicit ordering
INSERT INTO orders VALUES (1001, 42, 99.99);
-- After ALTER TABLE orders ADD COLUMN status VARCHAR(20);
-- the same statement now fails — the table has 4 columns
Fix — use an explicit column list so future schema changes don't silently break this:
INSERT INTO orders (order_id, customer_id, total) VALUES (1001, 42, 99.99);
Diagnostic Checks
- Count columns (explicit or from the table definition) against values in the
VALUESclause. - Carefully re-read the
VALUESclause for comma placement, especially around long strings or parenthesized expressions. - Check for a recent
ALTER TABLE ADD/DROP COLUMNif using an implicit-columnINSERT.
Related Errors / Related Topics
- -201 — "A syntax error has occurred." The general SQL-parsing-error family this fits into.
- -217 — "Column column-name not found in any table in the query." Another common, everyday query-construction error.
Prefer explicit column lists in INSERT statements going forward — it's the single best
prevention against this specific error recurring after future schema changes.