ALTER SEQUENCE
Syntax
ALTER SEQUENCE sequence_name
[ INCREMENT BY increment_value ]
[ MAXVALUE max_value | NOMAXVALUE ]
[ MINVALUE min_value | NOMINVALUE ]
[ CYCLE | NOCYCLE ]
Description
ALTER SEQUENCE is a SQL command used to alter one or more characteristics of a sequence.
Note that it is possible to put the sequence into a state from which no further values can be returned through the use of the alter command. For example, if the new max_value is less than the current value of the sequence for an ascending sequence, or if the new increment_value would make the next value be outside of the sequence bounds.
Return Values
Error Code |
Message |
Returned By |
---|---|---|
-20266 |
Sequence cannot be used here |
DROP SEQUENCE |
-20267 |
Sequence not found |
DROP SEQUENCE |
-20268 |
START-WITH/CURRENT-VALUE cannot be greater than MAXVALUE |
CREATE SEQUENCE |
-20269 |
START-WITH/CURRENT-VALUE cannot be less than MINVALUE |
CREATE SEQUENCE |
-20270 |
Invalid sequence MINVALUE specified |
CREATE SEQUENCE |
-20271 |
Invalid sequence INCREMENT specified |
CREATE SEQUENCE |
-20272 |
START-WITH cannot be altered in sequence |
CREATE SEQUENCE |
-20273 |
No options specified for ALTER SEQUENCE |
CREATE SEQUENCE |
-20274 |
Sequence increment has exceeded MAXVALUE |
CREATE SEQUENCE |
-20275 |
Sequence decrement has exceeded MINVALUE |
CREATE SEQUENCE |
-20276 |
Only SELECT and ALTER privileges are valid for sequences |
CREATE SEQUENCE |
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.
See Also