Informix Error -9634: No cast from <type-name>. </type-name>
Cause and resolution
No cast from <type-name>. </type-name>
The specified cast does not exist or the cast function does not exist. Use the CREATE CAST statement to define the cast or to create the cast function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9634 fires when a needed cast, or its cast function, doesn't exist — per the official guidance.
- The cast not defined, per the official guidance — the first named cause.
- The cast function not existing, per the official guidance — the second named cause.
Solutions / Resolution
- Use the CREATE CAST statement to define the cast, per the official guidance.
- Or create the cast function, per the official guidance.
Examples
Using a cast that was never defined
SELECT CAST(col AS other_type) FROM tab; -- -9634 if no cast exists
Corrected
CREATE CAST (source_type AS other_type WITH cast_func);
SELECT CAST(col AS other_type) FROM tab;
Diagnostic Checks
- Check the system catalog for the cast and its cast function, and create whichever is missing.
Related Errors / Related Topics
- -9633 — "ALTER TABLE cannot modify column (column_name) type. Need a cast from the current type to the new type." A related missing-cast error, specific to ALTER TABLE.
- -9635 — "An attempt has failed to convert an opaque type into another type without a cast function." A related missing-cast error, specific to opaque-type conversion.
- -9637 — "Cast function (function_name) does not exist." A related missing-cast error, on the cast function specifically rather than the cast itself.
The needed cast or cast function didn't exist — define it with CREATE CAST/CREATE FUNCTION.