NEXT
Purpose
Returns the succeeding value of the argument so that there is one granule of the argument type between the argument and the returned value.
Syntax
where:
Syntax element... |
Specifies... |
datetime_expression |
any expression that evaluates to a DATE, TIME, or TIMESTAMP data type. |
Return Value
The return data type is the same as that of the argument. If the value of the argument is NULL, the result is NULL.
Format and Title
The format is the default format for the data type of the proximity argument.
Error Conditions
If the argument does not have a DateTime data type, an error is reported.
If the result is outside the permissible range of a value for the argument's data type, an error is reported. For example, if NEXT(DATE '9999-12-31') is specified, an error is reported.
Example
Assume the following query is executed on the employee table where period1 is a PERIOD(DATE) column:
SELECT *
FROM employee
WHERE NEXT(END(period1)) = DATE '2004-03-06';
ename dept period1
----- ----------- ----------------------------
Jones Sales ('2004-01-02', '2004-03-05')
Simon Sales ?
The result is:
ename dept period1
----- ----------- ----------------------------
Jones Sales ('2004-01-02', '2004-03-05')