Re: [Zope] ZSQL Method Question

2006-07-19 Thread John Schinnerer
Aloha, I think so, for the moment anyhow! Thanks all, John S. Cliff Ford wrote: Comment on Peter's suggestion: I am no expert on these things, but it is my understanding that for MySQL LAST_INSERT_ID() fetches the last autoincrement value made by the current insert, so the outcome is not

Re: [Zope] ZSQL Method Question

2006-07-18 Thread Cliff Ford
This is how it works for MySQL: insert into org (org_name, org_phone) values ('x', 'y') dtml-var sql_delimiter select LAST_INSERT_ID() as org_id You have to have the select LAST_INSERT_ID call in the same query as the insert, and you have to have the sql_delimiter. I assume you know that the

Re: [Zope] ZSQL Method Question

2006-07-18 Thread Peter Bengtsson
What if you have 1,000,000 requests/sec? What if between the INSERT and the LAST_INSERT_ID() another INSERT is made? I use PostgreSQL and with postgres you can always ask the sequence what the next id is going to be. It goes something like this:: next_id = context.GetNextId()[0].next_id

Re: [Zope] ZSQL Method Question

2006-07-18 Thread Tino Wildenhain
Peter Bengtsson wrote: What if you have 1,000,000 requests/sec? What if between the INSERT and the LAST_INSERT_ID() another INSERT is made? I use PostgreSQL and with postgres you can always ask the sequence what the next id is going to be. It goes something like this:: next_id =

Re: [Zope] ZSQL Method Question

2006-07-18 Thread John Schinnerer
Aloha, Is this even easier solution only for postgreSQL, or is it for MySQL? I am going to have to start working with integrating MySQL into zope-based stuff soon so I'm trying to get a head start... :-) thanks, John S. Tino Wildenhain wrote: Peter Bengtsson wrote: What if you have

Re: [Zope] ZSQL Method Question

2006-07-18 Thread Cliff Ford
Comment on Peter's suggestion: I am no expert on these things, but it is my understanding that for MySQL LAST_INSERT_ID() fetches the last autoincrement value made by the current insert, so the outcome is not affected by virtually simultaneous requests. And I don't think MySQL accepts a value

[Zope] ZSQL Method Question

2006-07-17 Thread Benjamin Menking
New to python/Zope, old-timer on PHP I'm using MySQL and a ZSQL method to insert data into the database. ex: insert into org (org_name, org_phone) values ('x', 'y') What I'm trying to figure out is that org_id (also part of the org table, but not specified in the sql statement) is an

Re: [Zope] ZSQL Method Question

2006-07-17 Thread Jonathan
= ',rstat.data_dictionary()print 'rstat.dictionaries= ',rstat.dictionaries() hth Jonathan - Original Message - From: Benjamin Menking To: zope@zope.org Sent: Monday, July 17, 2006 1:01 PM Subject: [Zope] ZSQL Method Question New to python/Zope, old-timer