FirebirdSQL logo
 FILTEREXCEPTION 

Who Can Create a Sequence?

The CREATE SEQUENCE (CREATE GENERATOR) statement can be executed by:

  • Administrators

  • Users with the CREATE SEQUENCE (CREATE GENERATOR) privilege

The user executing the CREATE SEQUENCE (CREATE GENERATOR) statement becomes its owner.

Examples of CREATE SEQUENCE

  1. Creating the EMP_NO_GEN sequence using CREATE SEQUENCE.

    CREATE SEQUENCE EMP_NO_GEN;
  2. Creating the EMP_NO_GEN sequence using CREATE GENERATOR.

    CREATE GENERATOR EMP_NO_GEN;
  3. Creating the EMP_NO_GEN sequence with an initial value of 5 and an increment of 1.

    CREATE SEQUENCE EMP_NO_GEN START WITH 5;
  4. Creating the EMP_NO_GEN sequence with an initial value of 1 and an increment of 10.

    CREATE SEQUENCE EMP_NO_GEN INCREMENT BY 10;
  5. Creating the EMP_NO_GEN sequence with an initial value of 5 and an increment of 10.

    CREATE SEQUENCE EMP_NO_GEN START WITH 5 INCREMENT BY 10;