Toad World will be down for maintenance on July 3rd, 2015 from approximately 8:00 PM PST to 11:00 PM PST.
We are sorry for any inconvenience this may cause. Thank you.
Log-In to post
Example 1: The statement below creates a sequence named "tab_seq" that starts at 1, increments by 1 (INCREMENT 1 is the default), does not cycle (NO CYCLE is the default), and caches 50 values at a time (the default is 20).
CREATE SEQUENCE ORDER_SEQ
START WITH 1
Example 2: In the following example, we create a sequence called PROD_SEQ and use it in a table named PRODUCTS:
CREATE SEQUENCE PROD_SEQ
START WITH 1;
INSERT INTO PRODUCTS (PRODNO, PRODDESC)
VALUES (NEXT VALUE FOR PROD_SEQ, 100);
or to update the products:
SET PRODNO = NEXT VALUE FOR PROD_SEQ
WHERE PRODNO = 100;