Sequences in Oracle
A sequence is a database object that generates a sequence of unique numbers. Sequences are used to generate primary key values and other unique identifiers. Here is an example:
CREATE SEQUENCE order_seq
START WITH 1
INCREMENT BY 1
NOCACHE
NOCYCLE;
This creates a sequence named "order_seq" that starts with the value 1 and increments by 1 for each new value generated. The "NOCACHE" and "NOCYCLE" options specify that the sequence should not be cached and should not wrap around.
No comments:
Post a Comment