Custom Search
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




Of Interest

Be responsible for your future
Enter the USA legally!

Visa, Green Card, Citizenship, Passport
Consultation Services








Oracle » DDL » Design »

Creating and using a sequence

     





/* create a sequence for employee ids */

CREATE SEQUENCE EMP_ID_SEQ
INCREMENT BY 1
NOMINVALUE
NOMAXVALUE
NOCYCLE
CACHE 20
NOORDER ;

/ * use the next emp id, and increment the sequence */

INSERT INTO EMPLOYEE(EMP_ID, LNAME, FNAME)
VALUES (EMP_ID_SEQ.NEXTVAL, 'SMITH', 'JIM') ;


/* get the current value of the sequence */

INSERT INTO EMPLOYEE(EMP_ID, LNAME, FNAME)
VALUES (EMP_ID_SEQ.CURRVAL, 'SMITH', 'JIM') ;









Oracle : Related Topics

Oracle : DDL : Creating a table
Oracle : DDL : Creating indexes
Oracle : DDL : Creating constraints
Oracle : DDL : Synonyms and Database Links
Oracle : DDL : Changing a column's type or name
Oracle : DDL : Partitioned Tables
Oracle : DDL : Alter a column
Oracle : DDL : Creating an index with the nosort option
Oracle : DDL : Oracle data types

Sybase Web Site
Sybase iAnywhere Mobile Web Site
Oracle Enterprise Web Site



Get the latest Rocket99 news and tech tips via






Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2019 Stoltenbar Inc All Rights Reserved.