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 the

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 doe

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

2008-07-21 Thread mos
ace.html On Mon, 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 &quo

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

2008-07-21 Thread Phil
ote: >> > 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 i

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 d

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 co

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 i

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?

"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 rathe

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 -- __ ___ ___

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

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* involve