SQL - CREATE SEQUENCE
(Since v2.2)
Creates a new sequence.
Syntax
CREATE SEQUENCE <sequence> TYPE <CACHED|ORDERED> [START <start>] [INCREMENT <increment>] [CACHE <cache>]
Where:
sequenceis the sequence name to createTYPEcan be:CACHED, where each call to the.next()will result in a new valueORDERED, where the sequence will cache N items on each node, thus improving the performance if many.next()calls are required. However, this may create holes with numeration
startset the initial value of the sequenceincrementset the value to increment when.next()is calledcacheset the number of values to pre-cache in case the sequence is of type CACHED
See also
Examples
Create and use a new sequence to handle id numbers
CREATE SEQUENCE idseq TYPE ORDERED
INSERT INTO account SET id = sequence('idseq').next()
To know more about other SQL commands look at SQL commands.