<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.12-alpha" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Wishing for an in-place REPLACE in MySQL</title>
	<link>http://regex.info/blog/2007-01-16/336</link>
	<description>Not a photo blog, but sometimes I play one on TV</description>
	<pubDate>Tue, 02 Dec 2008 20:59:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.12-alpha</generator>

	<item>
		<title>by: Ask Bjørn Hansen</title>
		<link>http://regex.info/blog/2007-01-16/336#comment-3121</link>
		<pubDate>Mon, 22 Jan 2007 07:13:41 +0000</pubDate>
		<guid>http://regex.info/blog/2007-01-16/336#comment-3121</guid>
					<description>I didn't know about the VALUES(fieldname) thing, very neat.  Good reminder for me that you learn something when you help others. :-)

Yeah, it gets a bit verbose either way - but that's why you make your program generate that part of the SQL.  :-)

(Actually, I have Rose::DB::Object generate most of my SQL - except of course for those "must-be-really-super-perfectly-fast" situations where I'd also use "ON DUPLICATE KEY UPDATE ..." - hello irony).


  - ask</description>
		<content:encoded><![CDATA[<p>I didn&#8217;t know about the VALUES(fieldname) thing, very neat.  Good reminder for me that you learn something when you help others. <img src='http://regex.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Yeah, it gets a bit verbose either way - but that&#8217;s why you make your program generate that part of the SQL.  <img src='http://regex.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>(Actually, I have Rose::DB::Object generate most of my SQL - except of course for those &#8220;must-be-really-super-perfectly-fast&#8221; situations where I&#8217;d also use &#8220;ON DUPLICATE KEY UPDATE &#8230;&#8221; - hello irony).</p>
<p>  - ask
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jeffrey Friedl</title>
		<link>http://regex.info/blog/2007-01-16/336#comment-3090</link>
		<pubDate>Wed, 17 Jan 2007 00:55:20 +0000</pubDate>
		<guid>http://regex.info/blog/2007-01-16/336#comment-3090</guid>
					<description>Wow, thanks Ask, I obviously hadn't seen that.

It's more flexible than what I asked for, but unfortunately, requires more verbosity: if there are 97 fields of which 85 are being updated, you have to repeate the 85 fields both in the INSERT clause and in the UPDATE clause. At least since 4.1.1 you can use VALUES(fieldname) so that you have to repeat only the 85 field names, and not the 85 associated values....</description>
		<content:encoded><![CDATA[<p>Wow, thanks Ask, I obviously hadn&#8217;t seen that.</p>
<p>It&#8217;s more flexible than what I asked for, but unfortunately, requires more verbosity: if there are 97 fields of which 85 are being updated, you have to repeate the 85 fields both in the INSERT clause and in the UPDATE clause. At least since 4.1.1 you can use VALUES(fieldname) so that you have to repeat only the 85 field names, and not the 85 associated values&#8230;.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ask Bjørn Hansen</title>
		<link>http://regex.info/blog/2007-01-16/336#comment-3088</link>
		<pubDate>Tue, 16 Jan 2007 17:26:25 +0000</pubDate>
		<guid>http://regex.info/blog/2007-01-16/336#comment-3088</guid>
					<description>INSERT INTO foo (beep, foo) VALUES (...) &lt;a href='http://dev.mysql.com/doc/refman/4.1/en/insert-on-duplicate.html' class='quiet' rel="nofollow"&gt;ON DUPLICATE KEY&lt;/a&gt; UPDATE beep = 'blah', foo = foo + 2;

:-)


 - ask</description>
		<content:encoded><![CDATA[<p>INSERT INTO foo (beep, foo) VALUES (&#8230;) <a href='http://dev.mysql.com/doc/refman/4.1/en/insert-on-duplicate.html' class='quiet' rel="nofollow">ON DUPLICATE KEY</a> UPDATE beep = &#8216;blah&#8217;, foo = foo + 2;</p>
<p>:-)</p>
<p> - ask
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
