[Zope-DB] Getting a newly created record
Dieter Maurer
dieter at handshake.de
Fri Nov 18 16:04:00 EST 2005
Sean Fulmer wrote at 2005-11-17 17:04 +0000:
>How can I insert a new record and have the new record immediately returned to me
>as an object?
You must use database means for this.
If your database system supports the "sequence" datatype (and you
use it to generate a unique id) then you can use the sequence's
"curval" to reference the newly created record.
You can combine your insert and a select for the created record
in the same Z SQL Method (separated by "<dtml-sql-delimiter>" (or
similarly spelled).
--
Dieter
More information about the Zope-DB
mailing list