Informix Error -370
-370 Cannot drop last column.
This ALTER TABLE DROP statement would drop every column from the table. At least one column must be retained. Revise the statement to leave one column. Or if you do not want the table at all, use DROP TABLE to remove it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-370 is a structural guardrail: a table must always have at least one column, so an ALTER TABLE DROP that would remove the table's only remaining column is rejected outright.
- An
ALTER TABLE DROPstatement dropping every column in a single statement, or the last remaining one after several prior drops. - A sequence of
ALTER TABLE DROPstatements executed across multiple steps (e.g. in a migration script), where the final drop leaves nothing behind. - Table cleanup logic that intended to remove the table entirely, but used repeated
column-drops instead of
DROP TABLE.
Solutions / Resolution
- If the goal is to remove the table entirely, use
DROP TABLEinstead, per the official guidance, rather than dropping columns one by one. - If the table genuinely needs to keep existing with different columns, revise the statement to leave at least one column — restructure by adding replacement columns before dropping the old ones, if a full column swap is the actual intent.
Examples
Attempting to drop the last column
ALTER TABLE scratch_data DROP (last_remaining_column);
-- -370: scratch_data would have zero columns left
Fix — drop the table entirely if that's the actual goal:
DROP TABLE scratch_data;
Swapping columns without ever leaving the table empty
ALTER TABLE scratch_data ADD (new_column VARCHAR(20));
-- migrate/copy data from old_column to new_column as needed
ALTER TABLE scratch_data DROP (old_column);
-- succeeds: new_column remains
Diagnostic Checks
- Count the table's remaining columns before issuing an
ALTER TABLE DROP, to confirm at least one will remain afterward. - Clarify whether the actual intent is to remove the table entirely, in which case
DROP TABLEis the correct statement, not a sequence of column drops.
Related Errors / Related Topics
- -328 — "Column column-name already exists in table." Another
ALTER TABLE-related restriction, on the add side rather than the drop side.
If the goal is removing the table entirely, use DROP TABLE — a sequence of column drops can
never fully empty a table.