Informix Error -9844: Invalid function function_name used in a functional key.
Cause and resolution
Invalid function function_name used in a functional key.
The function used in a CREATE INDEX statement cannot be used as a functional key part. Make sure that the function you use is not a variant function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9844 fires when a function used as a CREATE INDEX functional key part isn't allowed there — per the official guidance.
- A variant function used as a functional key part, per the official guidance — the direct, only named cause.
Solutions / Resolution
- Make sure the function used isn't a variant function, per the official guidance — use a function created with NOT VARIANT.
Examples
A variant function used in a functional key
CREATE INDEX idx1 ON tab(my_variant_func(col)); -- -9844
Corrected
CREATE FUNCTION my_func(a INT) RETURNING INT NOT VARIANT ...;
CREATE INDEX idx1 ON tab(my_func(col));
Diagnostic Checks
- Check whether the function used in the functional key is variant or not variant, and switch to a NOT VARIANT function if needed.
Related Errors / Related Topics
- -9843 — "Invalid number of arguments for functional key." A related functional-key validity error, on argument count rather than the function being variant.
- -9848 — "Functional key part cannot use a variant function function_name." The same restriction, stated more explicitly for variant functions.
An invalid (variant) function was used as a functional key part — use a NOT VARIANT function instead.