[Zope] ZSQL - finding the id of what you just inserted?

Hannu Krosing hannu@tm.ee
Fri, 20 Apr 2001 23:05:40 +0200


The Doctor What wrote:
> 
> Howdy again....
> 
> I use a dtml-call to call a zsql object that does an insert.  I
> don't specify ID because ID is auto-sequenced by the DB.
> 
> How can I find out what the ID of that just inserted object is so I
> can do more operations on it?

I usually have my insert ZSQL-method return it

insert into mytable(name) values('myname')
;
select nextval('mytable_id_seq')


----------------
Hannu