Informix Error -25804: The interval value must be a non-zero positive constant.
Cause and resolution
The interval value must be a non-zero positive constant.
The resultant value of the expression for the interval value must be a non-zero positive constant. For example, the following statement generates an error:
CREATE TABLE address (street VARCHAR(128), city VARCHAR(32), state CHAR(2), zip INT) FRAGMENT BY RANGE(zip) INTERVAL(-1000) STORE IN (dbs1, dbs2, dbs3) PARTITION p1 VALUES < 10000 IN dbs3;
The interval value is negative.
The following statement also generates an error:
CREATE TABLE address (street VARCHAR(128), city VARCHAR(32), state CHAR(2), zip INT) FRAGMENT BY RANGE(zip) INTERVAL(zip) STORE IN (dbs1, dbs2, dbs3) PARTITION p1 VALUES < 10000 IN dbs3;
The interval value is the column zip, which is not a constant.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-25804 fires when an INTERVAL(...) fragmentation clause's value is negative, zero, or a
non-constant expression — per the official guidance.
- A negative or zero interval value, per the official guidance — the first named case.
- A non-constant interval value (e.g. a column reference), per the official guidance — the second named case.
Solutions / Resolution
- Supply a positive, non-zero constant for the interval value, per the official guidance.
Examples
A negative interval value
CREATE TABLE address (street VARCHAR(128), city VARCHAR(32), state CHAR(2), zip INT)
FRAGMENT BY RANGE(zip) INTERVAL(-1000) STORE IN (dbs1, dbs2, dbs3)
PARTITION p1 VALUES < 10000 IN dbs3;
-- -25804: interval value is negative
A non-constant interval value
CREATE TABLE address (street VARCHAR(128), city VARCHAR(32), state CHAR(2), zip INT)
FRAGMENT BY RANGE(zip) INTERVAL(zip) STORE IN (dbs1, dbs2, dbs3)
PARTITION p1 VALUES < 10000 IN dbs3;
-- -25804: zip is a column, not a constant
Diagnostic Checks
- Check the
INTERVAL(...)value's sign and check it's a constant, not a column expression.
Related Errors / Related Topics
- -25805 — "The interval value must be a numeric or INTERVAL data type." A related interval-value error, on data type rather than sign/constancy.
- -25806 — "The fragment key for interval fragmentation must be a numeric, DATE, or DATETIME type." A related interval-fragmentation restriction, on the fragment key.
- -25810 — "The fragment key, interval value, and upper limit of the fragments are not compatible." A related interval-fragmentation type-compatibility error.
- -25811 — "The transition value for interval fragments must be aligned to the boundary of the interval value type." A related interval-fragmentation error, on the transition value.
An INTERVAL(...) value was negative, zero, or non-constant — supply a positive, non-zero
constant.