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


Technical Guides
Sybase
Oracle
UNIX
Javascript




After Work

Highlife Adventures
The best club in Chicago
for Chicago Singles is Highlife Adventures!






Kyoto Sushi
in Chicago, on Lincoln Ave.
Moody's Pub
in Chicago, has great burgers
Skylark
in Chicago, on Halsted .. excellent beer selection!


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 Mobile Web Site
Oracle Web Site





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




Copyright © 2010 Stoltenbar Inc All Rights Reserved.