Informix Error -25851: The window-frame extent value specification are not correct.
Cause and resolution
The window-frame extent value specification are not correct.
If RANGE is specified, then the window-order clause in the window definition must contain a single sort key. The declared data type of the sort key can be numeric, DATETIME, or INTERVAL. The data type of the constant value in <unsigned-constant> FOLLOWING or <unsigned-constant> PRECEDING specifications must be a numeric if the sort key has a numeric data type. Otherwise, it must be an INTERVAL type that can be added to or subtracted from values of the declared type of the ORDER BY sort key. </unsigned-constant></unsigned-constant>
If ROWS is specified, then the declared type of the <unsigned-constant> must be an exact numeric data type with a scale of 0 (zero), such as INTEGER. </unsigned-constant>
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-25851 fires when a window-frame extent's value specification doesn't meet its type
rules — per the official guidance: for RANGE, the window-order clause needs a single sort
key of numeric/DATETIME/INTERVAL type, and the <unsigned-constant> FOLLOWING/
PRECEDING value must be numeric (for a numeric sort key) or an INTERVAL addable/
subtractable from the sort key's type; for ROWS, the constant must be an exact numeric
type with scale 0 (e.g. INTEGER).
- A
RANGE-based frame with a multi-key order clause, a non-numeric/DATETIME/INTERVALsort key, or an incompatibleFOLLOWING/PRECEDINGconstant type, per the official guidance — the first named case. - A
ROWS-based frame with a constant that isn't an exact, scale-0 numeric type, per the official guidance — the second named case.
Solutions / Resolution
- For
RANGE, use a single numeric/DATETIME/INTERVALsort key with a matchingFOLLOWING/PRECEDINGconstant type, per the official guidance. - For
ROWS, use an exact, scale-0 numeric constant such asINTEGER, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond an incorrect frame-extent value specification.
Diagnostic Checks
- Check the window-order clause's sort key type and the
FOLLOWING/PRECEDINGconstant's type, against theRANGE/ROWSrules above.
Related Errors / Related Topics
- -25850 — "The window-frame extent specification requires a window-order clause." A related window-frame error, on a missing order clause entirely.
- -25852 — "The window-frame extent BETWEEN options are not valid." A related
window-frame error, on
BETWEENsyntax generally.
A window-frame extent's value specification didn't meet the RANGE/ROWS type rules —
match the sort key and constant types accordingly.