<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to write flexible INSERT and UPDATE statements in MySQL</title>
	<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/</link>
	<description>Stay curious!</description>
	<pubDate>Sun, 20 Jul 2008 22:54:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Ben</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14889</link>
		<author>Ben</author>
		<pubDate>Fri, 18 Jul 2008 17:42:50 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14889</guid>
		<description>Thanks for posting this article.  I've been looking for atomic upserts, and the INSERT INTO ... ON DUPLICATE fits the bill nicely.  I would not have know about the syntax if I hadn't found this article on google.  Thanks for posting!</description>
		<content:encoded><![CDATA[<p>Thanks for posting this article.  I&#8217;ve been looking for atomic upserts, and the INSERT INTO &#8230; ON DUPLICATE fits the bill nicely.  I would not have know about the syntax if I hadn&#8217;t found this article on google.  Thanks for posting!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krzysztof Bieleńko</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14491</link>
		<author>Krzysztof Bieleńko</author>
		<pubDate>Tue, 29 Apr 2008 12:12:33 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14491</guid>
		<description>Wow, greate post!</description>
		<content:encoded><![CDATA[<p>Wow, greate post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14430</link>
		<author>M</author>
		<pubDate>Sun, 13 Apr 2008 15:01:57 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14430</guid>
		<description>I want to insert...update into multiple tables how do i do that? 
I have 3 tables e.g. table a table b table c. 
table a (a_id)
table b( b_id, a_id) //a_id-foreign key referencing table a
table c (c_id, b_id) //b_id-foreign key referencing table b

Thanks :)</description>
		<content:encoded><![CDATA[<p>I want to insert&#8230;update into multiple tables how do i do that?<br />
I have 3 tables e.g. table a table b table c.<br />
table a (a_id)<br />
table b( b_id, a_id) //a_id-foreign key referencing table a<br />
table c (c_id, b_id) //b_id-foreign key referencing table b</p>
<p>Thanks :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14274</link>
		<author>Xaprb</author>
		<pubDate>Mon, 10 Mar 2008 01:01:01 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14274</guid>
		<description>If you're using the MySQL monitor, you can see it in the status output after the query.  The warning count is passed back via the client protocol, but whether the tool you're using pays attention, and whether it displays anything if there are warnings, varies.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using the MySQL monitor, you can see it in the status output after the query.  The warning count is passed back via the client protocol, but whether the tool you&#8217;re using pays attention, and whether it displays anything if there are warnings, varies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: x</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14273</link>
		<author>x</author>
		<pubDate>Sun, 09 Mar 2008 22:54:45 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14273</guid>
		<description>How do I know if I got a warning?</description>
		<content:encoded><![CDATA[<p>How do I know if I got a warning?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ajos</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14140</link>
		<author>ajos</author>
		<pubDate>Wed, 09 Jan 2008 13:21:57 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14140</guid>
		<description>Hi Xaprb,
Good article. I have a situation here where i have in a table 2 rows like---&#62;
row1
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget
abc     411      10000          0      0        0

row2
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget
xyz     422        0            0      0         0

Whe way i want the query to work is, i want to swap the Bud_alloted value i.e 1lakh from branch abc into 2nd row's bud_alloted which is 0 now. And after swapping the value to 2nd row's bud_alloted, in the 1st row the value 1lakh should be set in the old_budget column i.e something like this after swapping--&#62;

row1
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget
abc     411           0         0      0      100000

row2
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget
xyz     422      100000         0      0        0

forgot to add 1 last bit here my branch,pub_cod is primary whereas am_paid and pub_cod are index key.
can this be achieved in mysql?
Thanks
regards,
ajos:)</description>
		<content:encoded><![CDATA[<p>Hi Xaprb,<br />
Good article. I have a situation here where i have in a table 2 rows like&#8212;&gt;<br />
row1<br />
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget<br />
abc     411      10000          0      0        0</p>
<p>row2<br />
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget<br />
xyz     422        0            0      0         0</p>
<p>Whe way i want the query to work is, i want to swap the Bud_alloted value i.e 1lakh from branch abc into 2nd row&#8217;s bud_alloted which is 0 now. And after swapping the value to 2nd row&#8217;s bud_alloted, in the 1st row the value 1lakh should be set in the old_budget column i.e something like this after swapping&#8211;&gt;</p>
<p>row1<br />
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget<br />
abc     411           0         0      0      100000</p>
<p>row2<br />
Branch  Pub_Cod  Bud_alloted  W_I_P  Am_Paid  Old_budget<br />
xyz     422      100000         0      0        0</p>
<p>forgot to add 1 last bit here my branch,pub_cod is primary whereas am_paid and pub_cod are index key.<br />
can this be achieved in mysql?<br />
Thanks<br />
regards,<br />
ajos:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Minh Hoang</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14097</link>
		<author>Minh Hoang</author>
		<pubDate>Tue, 18 Dec 2007 23:24:07 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14097</guid>
		<description>Hi Xarpb,

This article is excellence. However my situtation is slightly different. I have 2 databases with the same table structure and so on. Now I want to combine the data in 2 databases into 1,i.e merging them. Now if I want to merge two table that have a unique key (auto-increment) if duplicate key is found instead of updating the old records with the new one, I would like to insert the new one with the unique being auto incremented. How would you do that ?

Many thanks,

Minh Hoang</description>
		<content:encoded><![CDATA[<p>Hi Xarpb,</p>
<p>This article is excellence. However my situtation is slightly different. I have 2 databases with the same table structure and so on. Now I want to combine the data in 2 databases into 1,i.e merging them. Now if I want to merge two table that have a unique key (auto-increment) if duplicate key is found instead of updating the old records with the new one, I would like to insert the new one with the unique being auto incremented. How would you do that ?</p>
<p>Many thanks,</p>
<p>Minh Hoang</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serkan</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14069</link>
		<author>Serkan</author>
		<pubDate>Mon, 10 Dec 2007 09:48:48 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-14069</guid>
		<description>Thanks for great examples. You really helped me a lot.</description>
		<content:encoded><![CDATA[<p>Thanks for great examples. You really helped me a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-13637</link>
		<author>Matt</author>
		<pubDate>Wed, 07 Nov 2007 13:42:16 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-13637</guid>
		<description>Looked at Kettle a while back - couldn't get it to work properly.  I've got Talend running - too complex for me.  I'm using scripts at the moment but will have another look.  Downloaded the Toolkit and will have a play.  Thnks for the advice.</description>
		<content:encoded><![CDATA[<p>Looked at Kettle a while back - couldn&#8217;t get it to work properly.  I&#8217;ve got Talend running - too complex for me.  I&#8217;m using scripts at the moment but will have another look.  Downloaded the Toolkit and will have a play.  Thnks for the advice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-13636</link>
		<author>Xaprb</author>
		<pubDate>Wed, 07 Nov 2007 13:09:44 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/02/21/flexible-insert-and-update-in-mysql/#comment-13636</guid>
		<description>Take a look at Kettle -- it's an ETL system for MySQL.  Also MySQL Archiver from the MySQL Toolkit.</description>
		<content:encoded><![CDATA[<p>Take a look at Kettle &#8212; it&#8217;s an ETL system for MySQL.  Also MySQL Archiver from the MySQL Toolkit.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
