23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

START WITH<br />

MAXVALUE<br />

ALTER SEQUENCE<br />

Specifies the first sequence number generated. In an ascending sequence, the value must<br />

be greater than or equal to the MINVALUE. In a descending sequence, the value must be<br />

greater than or equal to the MAXVALUE. For ascending sequences, the default value is<br />

MINVALUE. For descending sequences, the default value is MAXVALUE.<br />

Specifies the maximum value for the sequence to generate. For both 32-bit and 64-bit<br />

descending sequences, the default value is -1. For a 32-bit ascending sequence, the default<br />

value is 2,147,483,647. For a 64-bit ascending sequence, the default value is<br />

9223372036854775807.<br />

NOMAXVALUE<br />

Specifies -1 as the MAXVALUE for 32-bit descending sequences and 2,147,483,647 as the<br />

MAXVALUE for 32-bit ascending sequences. Specifies -1 as the MAXVALUE for 64-bit<br />

descending sequences and 9223372036854775807 as the MAXVALUE for 64-bit ascending<br />

sequences.<br />

MINVALUE<br />

Specifies the minimum value the sequence can generate. For an ascending sequence, the<br />

default value is 0. For a descending sequence, the default value is -2,147,483,648 for<br />

32-bit sequences and -9223372036854775808 for 64-bit sequences.<br />

NOMINVALUE<br />

CYCLE<br />

NOCYCLE<br />

CURRVAL<br />

Specifies 0 as the MINVALUE for ascending sequences. The MINVALUE for descending<br />

sequences is -2,147,483,648 for 32-bit sequences and -9223372036854775808 for 64-bit<br />

sequences.<br />

Indicates that the sequence will continue to generate values after reaching the value<br />

assigned to MAXVALUE (if sequence ascends) or MINVALUE (if sequence descends).<br />

Indicates that the sequence cannot generate more values after reaching the value assigned<br />

to MAXVALUE (if sequence ascends) or MINVALUE (if sequence descends). The <strong>SQL</strong><br />

sequence generator uses NOCYCLE as the default if CYCLE is not specified.<br />

Returns the current value of the sequence.<br />

Notes • It is possible to set only one attribute of a sequence at a time.<br />

• Attributes START WITH, INCREMENT BY, MAXVALUE, MINVALUE and CURRVAL can take either<br />

an INTEGER or BIGINT argument, depending on whether the sequence is a 32-bit or 64-bit<br />

sequence. The following example modifies a sequence by specifying a maximum value:<br />

ALTER SEQUENCE pub.customer<br />

SET MAXVALUE 9000000000;<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!