<?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/"
		>
<channel>
	<title>Comments on: A Simple Example of a MySQL Stored Procedure that uses a cursor</title>
	<atom:link href="http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/</link>
	<description>Discussions on Ruby on Rails, Agile Development and the Boston Tech Scene.</description>
	<lastBuildDate>Fri, 13 Jan 2012 00:07:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Miguel Angel</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-215</link>
		<dc:creator>Miguel Angel</dc:creator>
		<pubDate>Fri, 13 Jan 2012 00:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-215</guid>
		<description>Gracias este tutorial me sirvio mucho, quisiera saber si no tienen uno para particionar las tablas. atte matrix_alfa@hotmail.com&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-215&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Gracias este tutorial me sirvio mucho, quisiera saber si no tienen uno para particionar las tablas. atte <a href="mailto:matrix_alfa@hotmail.com">matrix_alfa@hotmail.com</a>
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-215">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mm Cc</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-214</link>
		<dc:creator>Mm Cc</dc:creator>
		<pubDate>Thu, 12 Jan 2012 05:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-214</guid>
		<description>really nice&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-214&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>really nice
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-214">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaymary</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-199</link>
		<dc:creator>Kaymary</dc:creator>
		<pubDate>Sat, 03 Dec 2011 12:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-199</guid>
		<description>thanks very much!!!&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-199&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>thanks very much!!!
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-199">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Arendar</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-194</link>
		<dc:creator>Alexander Arendar</dc:creator>
		<pubDate>Fri, 11 Nov 2011 12:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-194</guid>
		<description>Thanks, very nice and elaborated article.&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-194&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Thanks, very nice and elaborated article.
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-194">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vicky Minu</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-193</link>
		<dc:creator>Vicky Minu</dc:creator>
		<pubDate>Fri, 28 Oct 2011 07:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-193</guid>
		<description>create procedue Get_Search_Results(@ghplid NVARCHAR(500)=NULL,@name Nvarchar(500)=NULL,@hospital Nvarchar(500)=NULL,@claimid NVARCHAR(500)=NULL)as
begin
declare @query varchar(4000)=&#039;select * from claim c join enroll e on c.policyno=e.policyno where 1=1 &#039;
  if @ghplid is not null
    begin
      set @query=@query+&#039;and PatientUHID=&#039;&#039;&#039;+@ghplid+&#039;&#039;&#039;&#039;
    end
  IF @name IS NOT NULL
  BEGIN
    SET @query=@query+&#039; AND PatientName=&#039;&#039;&#039;+@name+&#039;&#039;&#039;&#039;
  END
  IF @hospital IS NOT NULL
  BEGIN
    SET @query=@query+&#039; AND Hospital=&#039;&#039;&#039;+@hospital+&#039;&#039;&#039;&#039;
  END
  IF @claimid IS NOT NULL
  BEGIN
    SET @query=@query+&#039; AND Claimid=&#039;&#039;&#039;+@claimid+&#039;&#039;&#039;&#039;
  END
  --PRINT @QUERY
  EXEC (@query)
end

can some one help me how to wright this procedure in mysql &lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-193&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>create procedue Get_Search_Results(@ghplid NVARCHAR(500)=NULL,@name Nvarchar(500)=NULL,@hospital Nvarchar(500)=NULL,@claimid NVARCHAR(500)=NULL)as<br />
begin<br />
declare @query varchar(4000)=&#8217;select * from claim c join enroll e on c.policyno=e.policyno where 1=1 &#8216;<br />
  if @ghplid is not null<br />
    begin<br />
      set @query=@query+&#8217;and PatientUHID=&#8221;&#8217;+@ghplid+&#8221;&#8221;<br />
    end<br />
  IF @name IS NOT NULL<br />
  BEGIN<br />
    SET @query=@query+&#8217; AND PatientName=&#8221;&#8217;+@name+&#8221;&#8221;<br />
  END<br />
  IF @hospital IS NOT NULL<br />
  BEGIN<br />
    SET @query=@query+&#8217; AND Hospital=&#8221;&#8217;+@hospital+&#8221;&#8221;<br />
  END<br />
  IF @claimid IS NOT NULL<br />
  BEGIN<br />
    SET @query=@query+&#8217; AND Claimid=&#8221;&#8217;+@claimid+&#8221;&#8221;<br />
  END<br />
  &#8211;PRINT @QUERY<br />
  EXEC (@query)<br />
end</p>
<p>can some one help me how to wright this procedure in mysql
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-193">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudhakar Reddy</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-192</link>
		<dc:creator>Sudhakar Reddy</dc:creator>
		<pubDate>Wed, 19 Oct 2011 09:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-192</guid>
		<description>Good one. Very much helpful for me&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-192&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Good one. Very much helpful for me
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-192">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benito Cámela.</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-190</link>
		<dc:creator>Benito Cámela.</dc:creator>
		<pubDate>Thu, 22 Sep 2011 01:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-190</guid>
		<description>Me gustó y fundamentalmente me sirvió mucho.
Felicitaciones y gracias!&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-190&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Me gustó y fundamentalmente me sirvió mucho.<br />
Felicitaciones y gracias!
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-190">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Simple Example of a MySQL Stored Procedure that uses a cursor [ref] &#171; Morgen Free&#039;s Blog</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-187</link>
		<dc:creator>A Simple Example of a MySQL Stored Procedure that uses a cursor [ref] &#171; Morgen Free&#039;s Blog</dc:creator>
		<pubDate>Fri, 26 Aug 2011 17:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-187</guid>
		<description>[...] http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/ [...]&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-187&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<div style="">
<p>[...] <a href="http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/" rel="nofollow">http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/</a> [...]</p>
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-187">0</span> <small>(to vote for this comment, please visit the site)</small></p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Robson</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-186</link>
		<dc:creator>Jonathan Robson</dc:creator>
		<pubDate>Fri, 19 Aug 2011 22:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-186</guid>
		<description>Here&#039;s a couple more good examples of using SQL as a full-fledged scripting language: http://jnrbsn.com/2011/08/using-sql-as-a-full-fledged-procedural-scripting-language&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-186&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a couple more good examples of using SQL as a full-fledged scripting language: http://jnrbsn.com/2011/08/using-sql-as-a-full-fledged-procedural-scripting-language
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-186">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alma</title>
		<link>http://www.kbedell.com/2009/03/02/a-simple-example-of-a-mysql-stored-procedure-that-uses-a-cursor/comment-page-1/#comment-179</link>
		<dc:creator>Alma</dc:creator>
		<pubDate>Wed, 22 Jun 2011 21:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbedell.com/?p=18#comment-179</guid>
		<description>not a long time ago post. helped me a lot.. thanks!&lt;p class=&quot;top-comments&quot;&gt;Current score: &lt;span class=&quot;top-comments-karma&quot; id=&quot;karma-179&quot;&gt;0&lt;/span&gt; &lt;small&gt;(to vote for this comment, please visit the site)&lt;/small&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>not a long time ago post. helped me a lot.. thanks!
<p class="top-comments">Current score: <span class="top-comments-karma" id="karma-179">0</span> <small>(to vote for this comment, please visit the site)</small></p>
]]></content:encoded>
	</item>
</channel>
</rss>

