The use of sequences
Could somebody tell me how I can make efficient use of sequences? I am
familiar with Oracle's sequences and they usually work as the following
example:
INSERT INTO PERSON table(some_sequence.nextval,data,data,data);
How do they work in postgreSQL?
Roy
--
Roy Sigurd Karlsbakk - MCSE, CNE, CLS, ASE - <roy@christianianett.no>
ChristianiaNett A/S, Akersgt. 11, 0158 OSLO, +47 2247 3100
http://www.christianianett.no/ (norwegian)
At 17:40 +0300 on 18/8/98, Roy Sigurd Karlsbakk wrote:
Could somebody tell me how I can make efficient use of sequences? I am
familiar with Oracle's sequences and they usually work as the following
example:
INSERT INTO PERSON table(some_sequence.nextval,data,data,data);How do they work in postgreSQL?
Look in the manpage of create_sequence
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
CREATE SEQUENCE some_sequence start 1 increment 1;
CREATE TABLE person (
id int4 default nextval('some_sequence'),
name varchar(200),
description text);
INSERT INTO person VALUES(nextval('some_sequence'),'Jeremiah','not much');
or
INSERT INTO person(name,description) VALUES('Jeremiah','not much');
On Tue, 18 Aug 1998, Roy Sigurd Karlsbakk wrote:
Show quoted text
Could somebody tell me how I can make efficient use of sequences? I am
familiar with Oracle's sequences and they usually work as the following
example:
INSERT INTO PERSON table(some_sequence.nextval,data,data,data);How do they work in postgreSQL?
Roy
--
Roy Sigurd Karlsbakk - MCSE, CNE, CLS, ASE - <roy@christianianett.no>
ChristianiaNett A/S, Akersgt. 11, 0158 OSLO, +47 2247 3100
http://www.christianianett.no/ (norwegian)