Hi Allon,
Only one query can be sent to server at a time. But your particular case
can be handled with the single query
Insert Into orders (Number) select Max(Number) FROM Orders;
Anvar.
At 04:45 PM 19/03/2002 -0800, you wrote:
Hi All-
We are using the mm driver for MySQL and multiple
sql,Mysql
Hi Allon,
Sorry. It wont work. I didn't notice that you were inserting to the
same table as the select.
Anvar.
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
Thanks Anvar-
But I guess you didn't really follow this thread. We started with the
statement you are suggesting because we are porting from another datasource.
As it turns out, you cannot do a Insert ... Select from the same table in
MySQL.
It's supported in other databases, so I was
Hi All-
We are using the mm driver for MySQL and multiple statements in one
connection do not seem to be supported:
I.e.
SELECT @a:=MAX(Number) FROM Orders;insert into orders (Number) values (@a+1)
The driver throws a syntax error. You can do either one of these statements
on their own, and
At 16:45 -0800 3/19/02, Allon Bendavid wrote:
Hi All-
We are using the mm driver for MySQL and multiple statements in one
connection do not seem to be supported:
No. Multiple statements in one *string* are not supported, in the MM.MySQL
or any other API. The client-server protocol supports
Thanks Paul for all of the clarifications
Actually what I was saying was this:
I obviously didn't assume that sticking a semi-colon between statements
creates a transaction. I was leaving out the transaction/table lock
statements but I meant to illustrate that for instance:
LOCK TABLES Orders
At 18:37 -0800 3/19/02, Allon Bendavid wrote:
Thanks Paul for all of the clarifications
Actually what I was saying was this:
I obviously didn't assume that sticking a semi-colon between statements
creates a transaction. I was leaving out the transaction/table lock
statements but I meant to