INSERT ... SELECT ON DUPLICATE

2009-09-24 Thread dbrb2002-sql
Does anyone know if I can add a hint SQL_BUFFER_RESULT to INSERT .. SELECT ON DUPLICATE ex.. INSERT INTO foo SELECT SQL_BUFFER_RESULT* FROM bar ON DUPLICATE KEY UPDATE foo.X=.. Both my tables foo and bar are InnoDB; but the idea is to release the lock on bar as soon as possible by moving

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread mos
At 08:23 PM 7/20/2008, Perrin Harkins wrote: On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote: Is there a way to get Insert ... select ... On Duplicate Update to update the row with the duplicate key? That's what it does. Why can't it do this? What makes you think it can't

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread Perrin Harkins
On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote: I can't specify all of the columns in a Set statement in the OnDuplicate clause because I don't know what the column names are and there could be 100 columns. Write code to do it. There is no way around specifying the

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread mos
At 11:00 AM 7/21/2008, Perrin Harkins wrote: On Mon, Jul 21, 2008 at 11:44 AM, mos [EMAIL PROTECTED] wrote: I can't specify all of the columns in a Set statement in the OnDuplicate clause because I don't know what the column names are and there could be 100 columns. Write code to do

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread Phil
Insert ... select ... On Duplicate Update to update the row with the duplicate key? That's what it does. Why can't it do this? What makes you think it can't? - Perrin Perrin, I can't specify all of the columns in a Set statement in the OnDuplicate clause because I don't know what

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread mos
, Jul 21, 2008 at 11:44 AM, mos mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: At 08:23 PM 7/20/2008, Perrin Harkins wrote: On Sun, Jul 20, 2008 at 12:12 AM, mos mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: Is there a way to get Insert ... select ... On Duplicate Update to update the row

Re: Insert ... select ... On Duplicate Update Question

2008-07-21 Thread Perrin Harkins
On Mon, Jul 21, 2008 at 2:43 PM, mos [EMAIL PROTECTED] wrote: I thought if MySQL found a duplicate key on the insert, it would automatically update the existing row that it found with the results from table1 if I left out the column expressions in the update clause. But apparently it doesn't

Re: Insert ... select ... On Duplicate Update Question

2008-07-20 Thread Perrin Harkins
On Sun, Jul 20, 2008 at 12:12 AM, mos [EMAIL PROTECTED] wrote: Is there a way to get Insert ... select ... On Duplicate Update to update the row with the duplicate key? That's what it does. Why can't it do this? What makes you think it can't? - Perrin -- MySQL General Mailing List

Insert ... select ... On Duplicate Update Question

2008-07-19 Thread mos
Is there a way to get Insert ... select ... On Duplicate Update to update the row with the duplicate key? Otherwise I'll have to use Replace which is inefficient because it deletes the old duplicated row and then inserts the new row with the same key. I'd much rather have it update

Re: INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-27 Thread Tom Cunningham
Thanks Shawn, Sergei. I'll get onto the new version as soon as I can. Tom. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-25 Thread Sergei Golubchik
Hi! On Feb 24, Tom Cunningham wrote: It appears you can't combine an insert-select with an on-duplicate-key-update. You can, since 4.1.10 (and there're some problems with name resolution there, so better wait for 4.1.11 - search bugdb for details) Regards, Sergei -- __ ___ ___

INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-24 Thread Tom Cunningham
It appears you can't combine an insert-select with an on-duplicate-key-update. I would find it very useful if you *could* do this. I know it would be complicate how you would handle the syntax for what to do when you hit a duplicate key, could do this: update all the columns that are *not*

Re: INSERT .. SELECT ... ON DUPLICATE KEY UPDATE

2005-02-24 Thread SGreen
Tom Cunningham [EMAIL PROTECTED] wrote on 02/24/2005 11:31:31 AM: It appears you can't combine an insert-select with an on-duplicate-key-update. I would find it very useful if you *could* do this. I know it would be complicate how you would handle the syntax for what to do when you hit a