From: Jose' Soares Da Silva <sferac@bo.nettuno.it>
To: Jerome Knobl <jknobl@mandanet.ch>
Cc: wwwadmin@wizard.ca, PGsql <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] How to handle a requirement for nextval
Date: Tue, 19 May 1998 09:45:18 +0000 (UTC)
Message-ID: <Pine.LNX.3.96.980519094343.412A-100000@proxy.bazzanese.com> (raw)
In-Reply-To: <35612D1E.CC49CA67@mandanet.ch>
On Tue, 19 May 1998, Jerome Knobl wrote:
> I have got the same trouble. I found a first inellegant solution. Is to
> create a function which make an increment like that :
> create function last98_20_rubriques() returns int4
> as 'Select max(ref98_20_rubriques) as next from DB98_20_rubriques;'
> language 'sql';
>
> But I read yesterday that I have to use e SEQUENCE like :
>
> create table toto (id int4 PRIMARY KEY, test varchar);
> create sequence step1 increment 1 start 1000 minvalue 1000 maxvalue
> 999999;
>
> And after that I have normaly to do :
> insert into toto (id,test) values (step1.nextval,'sdf');
> But It's don't work.
> If you can go further send me a mail (and sorry for my very bad english).
insert into toto (id,test) values (nextval('step1'),'sdf');
Jose'
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: sferac@bo.nettuno.it, jknobl@mandanet.ch
Subject: Re: [SQL] How to handle a requirement for nextval
In-Reply-To: <Pine.LNX.3.96.980519094343.412A-100000@proxy.bazzanese.com>
References: <35612D1E.CC49CA67@mandanet.ch> <Pine.LNX.3.96.980519094343.412A-100000@proxy.bazzanese.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox