Informix Error -9633: ALTER TABLE cannot modify column (column_name) type. Need a cast from the current type to the new type.
Cause and resolution
ALTER TABLE cannot modify column (column_name) type. Need a cast from the current type to the new type.
Conversions of column types require a cast. Use the CREATE CAST statement to define a cast from the source to destination type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9633 fires when an ALTER TABLE MODIFY changes a column's type but no cast exists from the current type to the new one — per the official guidance.
- No CAST defined from the column's current type to the new type, per the official guidance — the direct, only cause; type conversions in ALTER TABLE require a cast.
Solutions / Resolution
- Use the CREATE CAST statement to define a cast from the source to destination type, per the official guidance.
Examples
An ALTER TABLE MODIFY with no available cast
ALTER TABLE tab MODIFY (col new_type); -- -9633 if no cast old_type -> new_type exists
Corrected — defining the cast first
CREATE CAST (old_type AS new_type WITH cast_func);
ALTER TABLE tab MODIFY (col new_type);
Diagnostic Checks
- Check the system catalog for a cast from the column's current type to the target type, and create one with CREATE CAST if missing.
Related Errors / Related Topics
- -9632 — "Value does not match the type of column (column_name)." A related casting error, on value assignment rather than an ALTER TABLE type change.
- -9634 — "No cast from
." The general no-such-cast error this is a specific case of, for ALTER TABLE column-type changes.
ALTER TABLE couldn't change the column's type because no cast exists — define one with CREATE CAST.