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
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
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
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 =
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
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
when you do an insert with a ZSQL method you do not
get back any info from mysql, you need to do a subsequent search to get
'autogenerated' columns. So do your insert, then do an ZSQL search.
The search returns a 'Results' object which has several methods you can use to
get at the search
I'm pretty sure that all variables have to be passed in explicitly
with SQLMethods. Namespaces are not passed in.
Try specifying username as an argument in the ZSQLMethods edit form
and pass it in like this:
dtml-in expr=
"lookup_by_username(username=REQUEST.AUTHENTICATED_USER.getUserName()"
sigh /
Thanks. It was a syntax issue. I think I tried every single variation on
passing variables to the method except that one. Sorry for the bother,
folks... :-)
On 18 Oct 2000, Jon Prettyman wrote:
I'm pretty sure that all variables have to be passed in explicitly
with SQLMethods.
meter list for this SQL method as well,
though it may not need to be...
Steve
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jon
Prettyman
Sent: Thursday, 19 October 2000 8:18
To: [EMAIL PROTECTED]
Subject: Re: [Zope] ZSQL Method AUTHENTICATED_USER
I'm p
I'm answering myself because I found a solution to my problem, and I
wanted to share the results with the list, in case someone is struggling
to try to do the same thing...
The problem with mysql (go easy, we're not talking about the fact that
mysql is primitive and overall does not match up to
Andreas writes:
ZSQLMethod's "advanced" property 'Maximum number of rows retrieved'
makes no sense to me.
It prevents stupid queries to kill Zope.
Assume, such a query returns 100.000.000 records.
This probably will let Zope require several GB memory.
As I know so far there is no way to
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Andreas
Sent: Saturday, June 10, 2000 1:59 AM
To: Umesh Soni
Cc: Phill Hugo; [EMAIL PROTECTED]
Subject: Re: [Zope] ZSQL method broken on 2.1.6
(using zope 2.1.6 with ZMySQLDA-2.0.0a1
Umesh Soni wrote:
(using zope 2.1.6 with ZMySQLDA-2.0.0a1 and MySQLdb-0.2.1)
Hi there,
I had this ZSQL method (simplified for clarity) working on 2.1.4
select id, nickname from bboard
where id=50
order by id desc
limit 30
Remove either the limit 30 or the LIMIT 1000 Advanced
Umesh Soni wrote:
(using zope 2.1.6 with ZMySQLDA-2.0.0a1 and MySQLdb-0.2.1)
Hi there,
I had this ZSQL method (simplified for clarity) working on 2.1.4
select id, nickname from bboard
where id=50
order by id desc
limit 30
Remove either the limit 30 or the LIMIT
Umesh Soni wrote:
Umesh Soni wrote:
(using zope 2.1.6 with ZMySQLDA-2.0.0a1 and MySQLdb-0.2.1)
Hi there,
I had this ZSQL method (simplified for clarity) working on 2.1.4
select id, nickname from bboard
where id=50
order by id desc
limit 30
Remove either
Oops, I forgot to mention that the CONV function is used in your ZSQL
method. Here's the ZSQL Method I use (returns upcoming birthdays falling
within this, and the next, month):
SELECT FirstName, LastName, MONTH(Birthday) AS Month, DAYOFMONTH(Birthday)AS
Day, DATE_FORMAT(Birthday, '%M %D, %Y')
17 matches
Mail list logo