Re: [Zope] insert_id with MySQL an Z SQL Method
Thanks for the answers. The keyword I missed was . Now it's working. Here my complete Z SQL Method: --- insert into categories (parent_id,logo,active) values ( , , ) select LAST_INSERT_ID() as table_id_seq --- --- "Allen Schmidt Sr." <[EMAIL PROTECTED]> wrote: > I have been using this successfully for a while. > Don't remember where I > found out about it though: > > insert stuff... > > > select alert_id from entertainment_alerts >where alert_id = @@identity > > > Allen > > > > Cliff Ford wrote: > > > Search the mailing list archives for July - there > were several > > contributions to this question. Roughly: > > > > insert ... > > > > select LAST_INSERT_ID() as table_id_seq > > > > Cliff > > > > Ferhat Ayaz wrote: > > > >> Hi, > >> > >> I have a Z SQL Method with an insert expression. > To > >> the inserted row will be assigned an > auto_increment > >> id. How can I get the last inserted id? > >> > >> I tryed the following both commands in one Z SQL > >> method. Unfortunatly this produces an error. > >> > >> insert into categories (parent_id,logo,active) > values > >> ( > >> , > >> , > >> , > >> ); > >> > >> SELECT currval('table_id_seq'); > >> > >> Thanks for your helps > >> > >> Greets, > >> Ferhat > >> > >> > >> > __ > >> Do You Yahoo!? > >> Tired of spam? Yahoo! Mail has the best spam > protection around > >> http://mail.yahoo.com > ___ > >> 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 ) > > > > ___ > > 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 ) > > > > > ___ > 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 ) > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ 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 )
Re: [Zope] insert_id with MySQL an Z SQL Method
I have been using this successfully for a while. Don't remember where I found out about it though: insert stuff... select alert_id from entertainment_alerts where alert_id = @@identity Allen Cliff Ford wrote: Search the mailing list archives for July - there were several contributions to this question. Roughly: insert ... select LAST_INSERT_ID() as table_id_seq Cliff Ferhat Ayaz wrote: Hi, I have a Z SQL Method with an insert expression. To the inserted row will be assigned an auto_increment id. How can I get the last inserted id? I tryed the following both commands in one Z SQL method. Unfortunatly this produces an error. insert into categories (parent_id,logo,active) values ( , , , ); SELECT currval('table_id_seq'); Thanks for your helps Greets, Ferhat __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ 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 ) ___ 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 ) ___ 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 )
Re: [Zope] insert_id with MySQL an Z SQL Method
Search the mailing list archives for July - there were several contributions to this question. Roughly: insert ... select LAST_INSERT_ID() as table_id_seq Cliff Ferhat Ayaz wrote: Hi, I have a Z SQL Method with an insert expression. To the inserted row will be assigned an auto_increment id. How can I get the last inserted id? I tryed the following both commands in one Z SQL method. Unfortunatly this produces an error. insert into categories (parent_id,logo,active) values ( , , , ); SELECT currval('table_id_seq'); Thanks for your helps Greets, Ferhat __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ 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 ) ___ 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 )
[Zope] insert_id with MySQL an Z SQL Method
Hi, I have a Z SQL Method with an insert expression. To the inserted row will be assigned an auto_increment id. How can I get the last inserted id? I tryed the following both commands in one Z SQL method. Unfortunatly this produces an error. insert into categories (parent_id,logo,active) values ( , , , ); SELECT currval('table_id_seq'); Thanks for your helps Greets, Ferhat __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ 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 )