NEXTVAL()

Scalar. The first call to this function returns 1, and then each subsequent call returns a value larger than that returned by the previous call.

Syntax

NEXTVAL()
Data Types

Return

Long

Usage

The return value from subsequent calls to NEXTVAL() always increases, but not necessarily by one; the increase may be larger. Sybase CEP Engine maintains state for NEXTVAL() by project instance, using a separate sequence for each instance. If persistence is enabled for your project, calling NEXTVAL() after a restart returns a value larger than the last call to NEXTVAL() before the restart. Each call to NEXTVAL() returns a new value, even if it is called more than once in a single statement.

Example

INSERT INTO OutStream
SELECT Price, Nextval()
FROM InStream;