<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: &#9733; 5 Recommendations About Cursor FOR Loops in Oracle PL/SQL</title>
	<atom:link href="http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Mon, 21 May 2012 00:26:47 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52852</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Wed, 10 Dec 2008 13:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52852</guid>
		<description>&lt;p&gt;Yeah, if it is completely ad-hoc, i sometimes get lazy and use the less typing method. But for real code, i usually snag a snippet.&lt;/p&gt;

&lt;p&gt;At some point, i simply remember the code. And the fact that a few more keystrokes are hit, are hardly recognized overall.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yeah, if it is completely ad-hoc, i sometimes get lazy and use the less typing method. But for real code, i usually snag a snippet.</p>

<p>At some point, i simply remember the code. And the fact that a few more keystrokes are hit, are hardly recognized overall.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52823</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Tue, 09 Dec 2008 19:19:26 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52823</guid>
		<description>&lt;p&gt;Regarding typing less code, in most well known SQL/PLSQL development IDEs you can define/re-use code snippets, sometimes called templates, to reduce the amount of time spent typing statements such as a BULK COLLECT routines.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Regarding typing less code, in most well known SQL/PLSQL development IDEs you can define/re-use code snippets, sometimes called templates, to reduce the amount of time spent typing statements such as a BULK COLLECT routines.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stew Stryker</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52820</link>
		<dc:creator>Stew Stryker</dc:creator>
		<pubDate>Tue, 09 Dec 2008 17:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52820</guid>
		<description>&lt;p&gt;Brian,&lt;/p&gt;

&lt;p&gt;Excellent counterpoint.  As I said, this isn&#039;t my logic, but that of others.&lt;/p&gt;

&lt;p&gt;But I disagree with your last point:&lt;/p&gt;

&lt;p&gt;&gt; It’s only faster and simpler because it is familiar. It could just as easily be the opposite way around with more use.&lt;/p&gt;

&lt;p&gt;You can&#039;t tell me there&#039;s less to type in a well-written BULK COLLECT routine than an implicit cursor FOR loop, especially if you&#039;re handling records instead of single columns.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Brian,</p>

<p>Excellent counterpoint.  As I said, this isn&#8217;t my logic, but that of others.</p>

<p>But I disagree with your last point:</p>

<p>&gt; It’s only faster and simpler because it is familiar. It could just as easily be the opposite way around with more use.</p>

<p>You can&#8217;t tell me there&#8217;s less to type in a well-written BULK COLLECT routine than an implicit cursor FOR loop, especially if you&#8217;re handling records instead of single columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52813</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Tue, 09 Dec 2008 14:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52813</guid>
		<description>&lt;p&gt;&gt;If the code won’t be used much&lt;/p&gt;

&lt;p&gt;Ha! If it isn&#039;t ad hoc (and even then) assume it will be used a lot. The reason we have bad code is specifically because people assume it won&#039;t be used much.&lt;/p&gt;

&lt;p&gt;&gt; and/or doesn’t give a significant performance improvement&lt;/p&gt;

&lt;p&gt;It doesn&#039;t give an improvement &lt;em&gt;when&lt;/em&gt;? Today when it works on three records, or in six months when it becomes the central batch processor?  Today when the DB load is low so it can spend significantly more resources on the processes or at month&#039;s end when due to reports running it causes all the reports on the system to run slower?&lt;/p&gt;

&lt;p&gt;&gt;coding faster using simpler techniques can be the way to go.&lt;/p&gt;

&lt;p&gt;It&#039;s only faster and simpler because it is familiar. It could just as easily be the opposite way around with more use.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&gt;If the code won’t be used much</p>

<p>Ha! If it isn&#8217;t ad hoc (and even then) assume it will be used a lot. The reason we have bad code is specifically because people assume it won&#8217;t be used much.</p>

<p>&gt; and/or doesn’t give a significant performance improvement</p>

<p>It doesn&#8217;t give an improvement <em>when</em>? Today when it works on three records, or in six months when it becomes the central batch processor?  Today when the DB load is low so it can spend significantly more resources on the processes or at month&#8217;s end when due to reports running it causes all the reports on the system to run slower?</p>

<p>&gt;coding faster using simpler techniques can be the way to go.</p>

<p>It&#8217;s only faster and simpler because it is familiar. It could just as easily be the opposite way around with more use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stew Stryker</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52764</link>
		<dc:creator>Stew Stryker</dc:creator>
		<pubDate>Mon, 08 Dec 2008 14:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52764</guid>
		<description>&lt;p&gt;Eddie,&lt;/p&gt;

&lt;p&gt;I wasn&#039;t the one to make the &quot;way more work&quot; comment, but I don&#039;t disagree with it entirely.&lt;/p&gt;

&lt;p&gt;To your reply &quot;“way more work” is not a good reason not to use BULK COLLECT.&quot;, I&#039;d say &quot;it depends.&quot;&lt;/p&gt;

&lt;p&gt;If the code won&#039;t be used much and/or doesn&#039;t give a significant performance improvement, then coding faster using simpler techniques can be the way to go.  And &lt;em&gt;that&#039;s&lt;/em&gt; why I have a few code templates for creating various types of BULK COLLECT procedures, so it&#039;s just as quick to create them as write an implicit FOR loop.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Stew&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Eddie,</p>

<p>I wasn&#8217;t the one to make the &#8220;way more work&#8221; comment, but I don&#8217;t disagree with it entirely.</p>

<p>To your reply &#8220;“way more work” is not a good reason not to use BULK COLLECT.&#8221;, I&#8217;d say &#8220;it depends.&#8221;</p>

<p>If the code won&#8217;t be used much and/or doesn&#8217;t give a significant performance improvement, then coding faster using simpler techniques can be the way to go.  And <em>that&#8217;s</em> why I have a few code templates for creating various types of BULK COLLECT procedures, so it&#8217;s just as quick to create them as write an implicit FOR loop.</p>

<p>Thanks,</p>

<p>Stew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52720</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Sun, 07 Dec 2008 00:09:24 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52720</guid>
		<description>&lt;p&gt;@Stew I agree with your point, which is another way of saying &quot;it depends&quot;. However, &quot;way more work&quot; is not a good reason not to use BULK COLLECT.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Stew I agree with your point, which is another way of saying &#8220;it depends&#8221;. However, &#8220;way more work&#8221; is not a good reason not to use BULK COLLECT.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stew Stryker</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52694</link>
		<dc:creator>Stew Stryker</dc:creator>
		<pubDate>Sat, 06 Dec 2008 11:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52694</guid>
		<description>&lt;p&gt;I sent this around to team mates and most thought that FOR loops are just fine thank-you-very-much and BULK COLLECTs are way more work.&lt;/p&gt;

&lt;p&gt;Even Feuerstein&#039;s article mentions that the FOR loops are okay for small datasets.  I tend to use them in that instance and BULK COLLECT for the larger ones.&lt;/p&gt;

&lt;p&gt;I&#039;d even go so far to say that, in many cases, the time you spend doing a cost-benefit analysis on existing FOR loops vs changing to BULK COLLECTs may actually exceed the amount of time the conversion would save!  But obviously there are some that really would benefit from a careful study.&lt;/p&gt;

&lt;p&gt;My point being, hard and fast rules like the 5 above are only useful guidelines and don&#039;t always apply.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I sent this around to team mates and most thought that FOR loops are just fine thank-you-very-much and BULK COLLECTs are way more work.</p>

<p>Even Feuerstein&#8217;s article mentions that the FOR loops are okay for small datasets.  I tend to use them in that instance and BULK COLLECT for the larger ones.</p>

<p>I&#8217;d even go so far to say that, in many cases, the time you spend doing a cost-benefit analysis on existing FOR loops vs changing to BULK COLLECTs may actually exceed the amount of time the conversion would save!  But obviously there are some that really would benefit from a careful study.</p>

<p>My point being, hard and fast rules like the 5 above are only useful guidelines and don&#8217;t always apply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52671</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Fri, 05 Dec 2008 17:42:03 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52671</guid>
		<description>&lt;p&gt;@Brian Yep, sometimes it depends on what you want to do.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Brian Yep, sometimes it depends on what you want to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52660</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Fri, 05 Dec 2008 13:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52660</guid>
		<description>&lt;p&gt;On a side note, i just changed an INSERT into a FOR loop. It was adding rights, and the statements checks if any rights conflict with the ones currently held. When adding more than one right, and those rights conflict, we give whichever right comes first in the passed TABLE. To do this, we used a FOR loop to INSERT each record individually.&lt;/p&gt;

&lt;p&gt;Sometimes you just have to use a loop.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>On a side note, i just changed an INSERT into a FOR loop. It was adding rights, and the statements checks if any rights conflict with the ones currently held. When adding more than one right, and those rights conflict, we give whichever right comes first in the passed TABLE. To do this, we used a FOR loop to INSERT each record individually.</p>

<p>Sometimes you just have to use a loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2008/11/10/5-recommendations-about-cursor-for-loops-in-oracle-plsql/comment-page-1/#comment-52616</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Thu, 04 Dec 2008 19:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=767#comment-52616</guid>
		<description>&lt;p&gt;@Daniel agreed. Also, let&#039;s not forget about the &lt;a href=&quot;http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/forall_statement.htm#LNPLS01321&quot; rel=&quot;nofollow&quot;&gt;FORALL&lt;/a&gt;.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Daniel agreed. Also, let&#8217;s not forget about the <a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/forall_statement.htm#LNPLS01321" rel="nofollow">FORALL</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

