What Is Sequence in Db2

A sequence is a software function that generates integer numbers in either ascending or descending order, within a definite range, to generate primary key and coordinate other keys among the table. You use sequence for availing integer numbers say, for employee_id or transaction_id.

How do you create a sequence in DB2?

  1. Specify an INCREMENT value of zero and a START WITH value that does not exceed MAXVALUE. …
  2. Specify the same value for START WITH, MINVALUE, and MAXVALUE, and specify CYCLE.

How do I delete a sequence in DB2?

To delete a sequence, use the DROP statement.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest