Sequences
Jump to navigation
Jump to search
A sequence is an object in oracle that is used to generate a number sequence. this can be useful when you need to create a unique number to act as a primary key.
CREATE SEQUENCE customer_sequence MINVALUE 1 MAXVALUE 9999 START WITH 1 INCREMENT BY 1 CACHE 10;
SELECT customer_sequence.NEXTVAL from dual; SELECT customer_sequence.CURRVAL from dual;