[Zope] next value

Olaf Zanger olaf.zanger@soli-con.com
Thu, 07 Dec 2000 13:04:32 +0100


Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------DC524EA913BA64A312DC85AC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

hi,
thanks for your help

i found the mistake:

> i work with postgreSQL 7.0.2, ZPyGreSQL and zope 2.2 on suse 7.0 linux
> 
> for a identifier field adr_id:serial i want to automatically insert a
> new number max(adr_id)+1
> 
> how can this be done in an insert into sql statement?
> 
> i tried nextval('adr_adr_id_seq') but get an error message

i create the database and load it then with the command:
> copy adr from stdin using delimiters ','
with this command i also load my serial field. even that i load 14 rows
the currval stays on 1
so the two lines

> insert into adr (id) values (setval('adr_adr_id_seq',15));
> select currval('adr_adr_id_seq');

get the value to the right level.

olaf



-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Zanger Nusch
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:info@soli-con.com
mailto:olaf.zanger@soli-con.com
http://www.soli-con.com
--------------DC524EA913BA64A312DC85AC
Content-Type: text/x-vcard; charset=us-ascii;
 name="olaf.zanger.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Olaf Zanger
Content-Disposition: attachment;
 filename="olaf.zanger.vcf"

begin:vcard 
n:Zanger;Olaf Marc
tel;cell:+41-76-572 9782
tel;work:+41-31-332 9782
x-mozilla-html:FALSE
url:www.soli-con.com
org:soli-con Engineering Zanger
adr:;;Lorrainestrasse 23;Bern;BE;3013;Switzerland
version:2.1
email;internet:olaf.zanger@soli-con.com
title:Dipl.-Ing.
note;quoted-printable:IT-Consulting=0D=0AEmbedded Systems=0D=0AEnergy Systems=0D=0AOpen Source Solutions=0D=0A
x-mozilla-cpt:;-32176
fn:Olaf Zanger
end:vcard

--------------DC524EA913BA64A312DC85AC--