Syntax

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram>>-CREATE SEQUENCE--sequence-name------------------------------->
 
   .---------------------------------------------.
   V                                        (1)  |
>----+------------------------------------+------+-------------><
     |     .-INTEGER---.                  |
     +-AS--+-data-type-+------------------+
     +-START WITH--numeric-constant-------+
     |               .-1----------------. |
     +-INCREMENT BY--+-numeric-constant-+-+
     | .-NO MINVALUE----------------.     |
     +-+-MINVALUE--numeric-constant-+-----+
     | .-NO MAXVALUE----------------.     |
     +-+-MAXVALUE--numeric-constant-+-----+
     | .-NO CYCLE-.                       |
     +-+-CYCLE----+-----------------------+
     | .-CACHE--20---------------.        |
     +-+-NO CACHE----------------+--------+
     | '-CACHE--integer-constant-'        |
     | .-NO ORDER-.                       |
     '-+-ORDER----+-----------------------'
 
Notes:
  1. The same clause must not be specified more than once.
Read syntax diagramSkip visual syntax diagramdata-type:
 
|--+-built-in-type------+---------------------------------------|
   '-distinct-type-name-'
 
built-in-type:
 
|--+-+---SMALLINT---+---------------------------+---------------|
   | +-+-INTEGER-+--+                           |
   | | '-INT-----'  |                           |
   | '---BIGINT-----'                           |
   |                  .-(5,0)-----------------. |
   '-+-+-DECIMAL-+-+--+-----------------------+-'
     | '-DEC-----' |  |             .-,0-.    |
     '-NUMERIC-----'  '-(--integer--+----+--)-'