<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-8902741043153755588.post162736297685006769..comments</id><updated>2010-07-23T20:56:20.906+10:00</updated><category term='Adobe'/><category term='Flash'/><category term='Microsoft'/><category term='iPhone'/><category term='Other'/><category term='Nintendo'/><category term='AIR'/><category term='ActionScript'/><category term='Flex'/><category term='iPad'/><category term='Windows'/><category term='ColdFusion Builder'/><category term='Apple'/><category term='ColdFusion'/><category term='Google'/><category term='.NET'/><category term='HTML 5'/><title type='text'>Comments on Dale Fraser's Blog: ColdFusion Convert A Query Row to a Struct in 1 li...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dale.fraser.id.au/feeds/162736297685006769/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html'/><author><name>Dale Fraser</name><uri>http://www.blogger.com/profile/08986411397740062717</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-MH0NL5rPjRY/TxO5ki19c-I/AAAAAAAAAEs/8TtUz9BEw6U/s220/376069_10150689828638136_677518135_12228999_1729982651_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-8872029616961678786</id><published>2010-07-23T20:56:20.906+10:00</published><updated>2010-07-23T20:56:20.906+10:00</updated><title type='text'>Hmmm, you don&amp;#39;t need those parentheses, and si...</title><content type='html'>Hmmm, you don&amp;#39;t need those parentheses, and since a column name must be at least one character, you should use + instead of *, so the expression can be: &amp;#39;\b[^,]+\b&amp;#39;&lt;br /&gt;With the replace being: &amp;#39;&amp;quot;\0&amp;quot; : &amp;quot;##q.\0[1]##&amp;quot;&amp;#39;&lt;br /&gt;&lt;br /&gt;Actually, no need for the word boundaries either, it can be &amp;#39;[^,]+&amp;#39; and &amp;#39;##q[&amp;#39;\0&amp;#39;][1]##&amp;#39;&lt;br /&gt;&lt;br /&gt;And case-sensitivity doesn&amp;#39;t come into it, so overall it could be changed to:&lt;br /&gt;&amp;lt;cfset qRow = deserializeJson(&amp;quot;{#evaluate(DE(&amp;quot;#REReplace(q.ColumnList, &amp;#39;[^,]+&amp;#39;, &amp;#39;&amp;quot;\0&amp;quot; : &amp;quot;##q[&amp;quot;\0&amp;quot;][1]##&amp;quot;&amp;#39;, &amp;#39;ALL&amp;#39;)#&amp;quot;))#}&amp;quot;) /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However, I can&amp;#39;t think of any benefit to that over doing a simple loop:&lt;br /&gt;&lt;br /&gt;&amp;lt;cfset qRow = StructNew() /&amp;gt;&lt;br /&gt;&amp;lt;cfloop index=&amp;quot;CurCol&amp;quot; list=&amp;quot;#q.ColumnList#&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;cfset qRow[CurCol] = q[CurCol][1] /&amp;gt;&lt;br /&gt;&amp;lt;/cfloop&amp;gt;&lt;br /&gt;&lt;br /&gt;If you want that to be one line, make it a function and do:&lt;br /&gt;&amp;lt;cfset qRow = QueryRowToStruct(q,1) /&amp;gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/8872029616961678786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/8872029616961678786'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279882580906#c8872029616961678786' title=''/><author><name>Peter Boughton</name><uri>http://www.sorcerers-isle.net</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-181664191'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-1572204795658927791</id><published>2010-07-23T12:28:42.404+10:00</published><updated>2010-07-23T12:28:42.404+10:00</updated><title type='text'>Oh and well done Steve, I didn&amp;#39;t see that you ...</title><content type='html'>Oh and well done Steve, I didn&amp;#39;t see that you had written it :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/1572204795658927791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/1572204795658927791'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279852122404#c1572204795658927791' title=''/><author><name>Steve Glachan</name><uri>http://www.frieswiththat.com.au</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-853725400'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-7193790939028904716</id><published>2010-07-23T12:22:48.324+10:00</published><updated>2010-07-23T12:22:48.324+10:00</updated><title type='text'>@Steve Onnis
Yeah I was wondering the same thing. ...</title><content type='html'>@Steve Onnis&lt;br /&gt;Yeah I was wondering the same thing. I generally don&amp;#39;t use Evaluate() if there is another efficient way to get around it (there often is).&lt;br /&gt;Performance from what I hear has improved greatly and as for security in this case, the inputs look pretty controlled to me. Looks secure. A speed comparison to a looped solution might be cool to see.&lt;br /&gt;&lt;br /&gt;Nice post Dale, bookmarked :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/7193790939028904716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/7193790939028904716'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279851768324#c7193790939028904716' title=''/><author><name>Steve Glachan</name><uri>http://www.frieswiththat.com.au</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-87763632'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-6576372445455508589</id><published>2010-07-22T22:19:14.891+10:00</published><updated>2010-07-22T22:19:14.891+10:00</updated><title type='text'>So its isn&amp;#39;t a performence issue then, a secur...</title><content type='html'>So its isn&amp;#39;t a performence issue then, a security issue?  If you are in control over what is being evaluated then the argument is void as as far as i am concerned.  Like anything..it&amp;#39;s bad if you use it poorly</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/6576372445455508589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/6576372445455508589'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279801154891#c6576372445455508589' title=''/><author><name>Steve Onnis</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-415630416'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-311308002058778144</id><published>2010-07-22T21:46:48.286+10:00</published><updated>2010-07-22T21:46:48.286+10:00</updated><title type='text'>@Steve Onnis: It has everything to do with the pri...</title><content type='html'>@Steve Onnis: It has everything to do with the principle behind the function: allowing unknown code to be executed on the server. It&amp;#39;s just a potential security risk and should therefore be avoided at all times.&lt;br /&gt;&lt;br /&gt;At least, that&amp;#39;s what I think. :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/311308002058778144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/311308002058778144'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279799208286#c311308002058778144' title=''/><author><name>Michiel</name><uri>http://www.blogger.com/profile/07084622563128098615</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1957721955'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-2490233840191549893</id><published>2010-07-22T21:34:45.327+10:00</published><updated>2010-07-22T21:34:45.327+10:00</updated><title type='text'>And why exactly is Evaluate() bad? Its performence...</title><content type='html'>And why exactly is Evaluate() bad? Its performence has improved heaps since CF6 and i honestly don&amp;#39;t see why it is so bad...unless someone can prove its evilness?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/2490233840191549893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/2490233840191549893'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279798485327#c2490233840191549893' title=''/><author><name>Steve Onnis</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1094842904'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-1592435482630864311</id><published>2010-07-22T20:38:44.698+10:00</published><updated>2010-07-22T20:38:44.698+10:00</updated><title type='text'>I agree, its very cool, and shows the possibilitie...</title><content type='html'>I agree, its very cool, and shows the possibilities  but I do use a small function and loop over in real use.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/1592435482630864311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/1592435482630864311'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279795124698#c1592435482630864311' title=''/><author><name>Dale Fraser</name><uri>http://www.blogger.com/profile/01158374758760646663</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_RYyHI44dl8g/S8fBcRHoScI/AAAAAAAAB-8/myICpIr_1Uc/S220/n677518135_9835.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1803342880'/></entry><entry><id>tag:blogger.com,1999:blog-8902741043153755588.post-8383489236730433824</id><published>2010-07-22T20:32:22.022+10:00</published><updated>2010-07-22T20:32:22.022+10:00</updated><title type='text'>I would call this a nice proof-of-concept, but wou...</title><content type='html'>I would call this a nice proof-of-concept, but would never use it in any serious production environment. I avoid usage of the Evaluate() function at all times because it just means trouble.&lt;br /&gt;&lt;br /&gt;I would go with a UDF. Shouldn&amp;#39;t be that hard.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/8383489236730433824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8902741043153755588/162736297685006769/comments/default/8383489236730433824'/><link rel='alternate' type='text/html' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html?showComment=1279794742022#c8383489236730433824' title=''/><author><name>Michiel</name><uri>http://www.blogger.com/profile/07084622563128098615</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://dale.fraser.id.au/2010/07/coldfusion-convert-query-row-to-struct.html' ref='tag:blogger.com,1999:blog-8902741043153755588.post-162736297685006769' source='http://www.blogger.com/feeds/8902741043153755588/posts/default/162736297685006769' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1957721955'/></entry></feed>
