Informix Error -25862: The argument to RATIO_TO_REPORT window function is invalid.
Cause and resolution
The argument to RATIO_TO_REPORT window function is invalid.
The argument to RATIO_TO_REPORT window function needs to be of numeric data type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-25862 fires when RATIO_TO_REPORT()'s argument isn't a numeric data type — per the
official guidance.
- A non-numeric
RATIO_TO_REPORT()argument, per the official guidance — the direct, only cause.
Solutions / Resolution
- Supply a numeric argument to
RATIO_TO_REPORT(), per the official guidance.
Examples
A non-numeric RATIO_TO_REPORT argument
SELECT customer_id, RATIO_TO_REPORT(cust_name) OVER () FROM orders;
-- -25862: cust_name is CHAR, not numeric
Corrected
SELECT customer_id, RATIO_TO_REPORT(total) OVER () FROM orders;
Diagnostic Checks
- Check the data type of the value passed to
RATIO_TO_REPORT(), and confirm it's numeric.
Related Errors / Related Topics
- -25859 — "The argument to NTILE window function is invalid." A related
window-function argument-validity error, for
NTILErather thanRATIO_TO_REPORT. - -25860 — "The offset of the LEAD, LAG window function is invalid." A related
window-function argument-validity error, for
LEAD/LAG.
RATIO_TO_REPORT()'s argument wasn't numeric — supply a numeric value.