CURRVAL

Returns the last value across all nodes that was set by NEXTVALon this sequence in the current session. If NEXTVAL was never called on this sequence since its creation, Vertica returns an error.

Behavior Type

Volatile

Syntax

CURRVAL('[[database.]schema.]sequence-name')

Parameters

[database.]schema

Specifies a schema, by default public. If schema is any schema other than public, you must supply the schema name. For example:

myschema.thisDbObject

If you specify a database, it must be the current database.

sequence‑name

The target sequence

Privileges

Restrictions

You cannot invoke CURRVAL in a SELECT statement, in the following contexts:

You also cannot invoke CURRVAL to act on a sequence in:

Examples

See Creating and Using Named Sequences in the Administrator's Guide