[Twisted-Python] enterprise.row

Federico Di Gregorio fog at initd.org
Mon Apr 7 14:15:37 EDT 2003


Il lun, 2003-04-07 alle 18:28, David Phillips ha scritto:
> Justin Ryan writes:
> > I think that if you insert a row and allow the database to assign the
> > pkey, you can select out the pkey.  I'm not sure this is more
> > efficient than selecting nextval() before insert, but it would be more
> > database-independent..
> 
> Some databases have an efficient way to get the key for the last row that
> was inserted.  MySQL, for example, has mysql_insert_id() and
> LAST_INSERT_ID():

DBAPI-2.0 defines an optional .lastrowid attribute on cursors.
 
-- 
Federico Di Gregorio
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
                      The number of the beast: vi vi vi. -- Delexa Jones
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030407/c41bf2ed/attachment.pgp 


More information about the Twisted-Python mailing list