Informix Error -25859: The argument to NTILE window function is invalid.
Cause and resolution
The argument to NTILE window function is invalid.
The argument to NTILE window function needs to be positive non-zero numeric value.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-25859 fires when NTILE()'s argument isn't a positive, non-zero numeric value — per the
official guidance.
- An
NTILE()argument that's zero, negative, or non-numeric, per the official guidance — the direct, only cause.
Solutions / Resolution
- Supply a positive, non-zero numeric argument to
NTILE(), per the official guidance.
Examples
An invalid NTILE argument
SELECT customer_id, NTILE(0) OVER (ORDER BY total) FROM orders;
-- -25859: 0 is not a positive non-zero value
Corrected
SELECT customer_id, NTILE(4) OVER (ORDER BY total) FROM orders;
Diagnostic Checks
- Check the value passed to
NTILE(), and confirm it's a positive, non-zero number.
Related Errors / Related Topics
- -25860 — "The offset of the LEAD, LAG window function is invalid." A related
window-function argument-validity error, for
LEAD/LAGrather thanNTILE.
NTILE()'s argument wasn't a positive, non-zero number — supply one.