1. the auto-Increment Function in Oracle can only be completed by sequence. All auto-increment operations must be completed by the user. Sequence creation format: [SQL] CREATE SEQUENCE sequence [INCREMENT BY n] [STARTWITH n] [{MAXVALUE n | NOMAXVALUE}] [{MINVALUE n | NOMINVALUE}] [{CYCLE | NOCYCLE}] [{ CACHE n | NOCACHE}]; example of www.2cto.com: Create a sequence of myseq to verify auto-increment operations. [SQL] CREATE SEQUENCE myseq; after the SEQUENCE is created, the user should handle all automatic growth. Therefore, the following two operations are provided in the SEQUENCE: nextVal: the next content of the learned sequence, currVal: the current content example of the de-sequence: CREATE an operation for verifying the sequence [SQL] CREATE TABLE testseq (next NUMBER, curr NUMBER ); now, when adding data to a table, you need to manually use the sequence example: Use the sequence [SQL] INSERT INTO testseq (next, curr) VALUES (myseq. nextval, myseq. currval); www.2cto.com. Query the testseq table: [SQL] SELECT * FROM testseq; you can find that the content of newVal is an operation that increases automatically, while currVal uses the sequence result of the current operation. That is to say, the current growth of this sequence is 1, and the growth of the sequence can be modified. Example of each increment by length: delete SEQUENCE: [SQL] drop sequence myseq; re-create sequence: [SQL] CREATE SEQUENCE myseq INCREMENT BY 2; then CREATE a table and perform test: [SQL] drop table testseq; create table testseq (next NUMBER, curr NUMBER); www.2cto.com INSERT 5 pieces of data, test: [SQL] INSERT INTO testseq (next, curr) VALUES (myseq. nextval, myseq. currval); by default, the sequence starts from 1, you can also use start with to specify its starting position. [SQL] DROP SEQUENCE myseq; CREATE SEQUENCE myseq INCREMENT BY 2 STARTWITH 10; -- CREATE a SEQUENCE starting from 10 and set the fixed values to 1, 3, 5, 7, and 9, cyclic sequence. [SQL] DROP SEQUENCE myseq; CREATE SEQUENCE myseq MAXVALUE 10 INCREMENT BY 2 START WITH 1 CACHE 2 CYCLE;