Informix Error -717: Invalid argument passed to system function function-name.
Cause and resolution
Invalid argument passed to system function function-name.
An invalid data type has been passed to one of the arithmetic functions (HEX(), TRUNC(), ROUND()).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-717 fires when HEX(), TRUNC(), or ROUND() is called with an argument of an invalid data
type — per the official guidance, these three arithmetic functions require a compatible numeric
(or, for HEX(), integer) argument type.
HEX()called with a non-integer argument, per the official guidance —HEX()converts an integer to its hexadecimal string representation and needs an integer type to work with.TRUNC()/ROUND()called with a non-numeric argument (a character or date value that wasn't implicitly convertible), per the official guidance.- A column or expression of an unexpected type passed to one of these three functions, assuming an implicit conversion would happen when it actually can't for this specific type/function combination.
Solutions / Resolution
- Check the argument's actual data type against what the specific function
(
HEX()/TRUNC()/ROUND()) requires. - Cast the argument to a compatible type explicitly, if a valid conversion exists:
SELECT HEX(order_id::INT) FROM orders; - Confirm the correct column/expression is actually being passed, in case a type mismatch points to referencing the wrong column.
Examples
An invalid argument type
SELECT HEX(status) FROM orders;
-- -717: status is CHAR(10), HEX() requires an integer argument
Corrected — the intended integer column
SELECT HEX(order_id) FROM orders;
Diagnostic Checks
- Identify the specific
function-namenamed in the error (HEX/TRUNC/ROUND) and check its documented argument-type requirement against what's actually being passed.
Related Errors / Related Topics
- -647 — "Error evaluating math library function function-name." A related math-function error, about a mathematically invalid value (correct type, wrong domain) rather than a wrong argument type.
- -664 — "Wrong number of arguments to system function function-name." A related system-function error, about argument count rather than argument type.
Specific to HEX()/TRUNC()/ROUND() — check the argument's actual type against what each
function requires.