On 11.06.09 14:36, Merav Ben-David wrote:
>
>  
>
> 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.
>

You should be able to write two ZSQL methods and wrap them into a
PythonScript. So you call the PythonScript
instead of the ZSQL method(s) directly. In addition there is a
sql-delimiter tag in DTML afaik - possibly
undocumented. I would go for the PythonScript + 2 ZSQL methods approach.

-aj
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

_______________________________________________
Zope maillist  -  Zope@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 )

Reply via email to