Oracle7 Server SQL Reference

Contents Index Home Previous Next

ALTER SEQUENCE

Purpose

To change the sequence in one of these ways:

Prerequisites

The sequence must be in your own schema or you must have ALTER privilege on the sequence or you must have ALTER ANY SEQUENCE system privilege.

If you are using Trusted Oracle7 in DBMS MAC mode, your DBMS label must match the sequence's creation label or you must satisfy one of these criteria:

Syntax

Keywords and Parameters

The keywords and parameters in this command serve the same purpose that they do in the CREATE SEQUENCE command [*].

Usage Notes

The sequence must be dropped and recreated to restart the sequence at a different number. Only future sequence numbers are affected by the ALTER SEQUENCE command.

Some validations are performed. For example, a new MAXVALUE cannot be imposed that is less than the current sequence number.

Example I

This statement sets a new maximum value for the ESEQ sequence:

ALTER SEQUENCE eseq 
	MAXVALUE 1500 

Example II

This statement turns on CYCLE and CACHE for the ESEQ sequence:

ALTER SEQUENCE eseq 
	CYCLE
 	CACHE 5 

Related Topics

CREATE SEQUENCE command [*] DROP SEQUENCE command [*]


Contents Index Home Previous Next