[Zope] Getting Auto Increment value
robert rottermann
robert at redcor.ch
Thu Jun 11 09:18:50 EDT 2009
to my knowledge SELECT LAST_INSERT_ID();
is per connection.
so if you do the call in the same request in which you did the the creation of
the record, you should be fine
robert
Merav Ben-David schrieb:
>
>
>
>
> I am working with zope & mysql.
>
> I have a table with SERIAL column type, I create "z-sql method" for
> insert operation, how can I get the value for the auto increment column?
>
> I know that in mysql I can call last_insert_id(), how do I call it,
> should I create another "z sql method" and if I do, how can I be sure
> the the value return is for my insert command and not for another. Is
> there a way to call 2 query from the same "z sql method"?
>
>
>
> I am really lost on this, any help will be wellcom.
>
> Thank in advanced.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope
mailing list