Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Jeff Rule: "I have to tell you I am really impressed. I have never had a software company turn around a bug fix like this so fast. I have been doing database work for over 20 years and that has never happened.".
Ilakshi Rathod : "This tool is just wonderful. I have never seen any tool for DB2. This tool provides very good features which helps in ease us work as well as quick resolution of any errors.".

More

Add your opinion

SQL Maestro Group / Products / DB2 / DB2 Maestro / Documentation

DB2 Maestro online Help

Prev Return to chapter overview Next

Sequences

Sequence is a database object from which multiple users may generate unique integers. You can use sequences to automatically generate primary key values.

 

When a sequence number is generated, the sequence is incremented, independent of the transaction committing or rolling back. If two users concurrently increment the same sequence, then the sequence numbers each user acquires may have gaps, because sequence numbers are being generated by the other user. One user can never acquire the sequence number generated by another user. Once a sequence value is generated by one user, that user can continue to access that value regardless of whether the sequence is incremented by another user.

 

 

New sequences are created within Create Sequence Wizard. In order to run the wizard you should either

 

select the Object | Create Database Object... main menu item;
select the Sequence icon in the Create Database Object dialog

or

select the Sequences list or any object from that list in the explorer tree;
select the Create New Sequence... item from the popup menu

or

open the schema in Schema Editor and the Sequences tab there;
press the Insert key or select the Create New Sequence item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

       

To create a new sequence with the same properties as one of the existing sequences has:

 

select the Object | Duplicate Database Object... main menu item;
follow the instructions of Duplicate Object Wizard.

 

 

 

Sequences can be edited within Sequence Editor. In order to run the editor you should either

 

select the sequence for editing in the explorer tree (type the first letters of the sequence name for quick search);
select the Edit Sequence ... item from the popup menu

or

open the schema in Schema Editor and the Sequences tab there;
select the sequence to edit;
press the Enter key or select the Edit Sequence item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar).

 

 

 

To drop a sequence:

 

select the sequence to drop in the explorer tree;
select the Drop Sequence item from the popup menu

or

open the schema in Schema Editor and the Sequences tab there;
select the sequence to drop;
press the Delete key or select the Drop Sequence item from the popup menu (alternatively, you may use the corresponding link of the Navigation Bar)

 

and confirm dropping in the dialog window.

 



Prev Return to chapter overview Next