<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PC Pro blog &#187; stored procedures</title>
	<atom:link href="http://www.pcpro.co.uk/blogs/tag/stored-procedures/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pcpro.co.uk/blogs</link>
	<description>Blogging in the real world</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:54:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>When to use Stored Procedures</title>
		<link>http://www.pcpro.co.uk/blogs/2008/05/18/when-to-use-stored-procedures/</link>
		<comments>http://www.pcpro.co.uk/blogs/2008/05/18/when-to-use-stored-procedures/#comments</comments>
		<pubDate>Sun, 18 May 2008 20:35:05 +0000</pubDate>
		<dc:creator>Kevin Partner</dc:creator>
				<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[kevin partner]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[stored procedures]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=699</guid>
		<description><![CDATA[Version 5 of MySQL added Stored Procedures and, as is often the case when you&#8217;ve been using earlier versions, I didn&#8217;t notice at all, until a client asked whether the site I&#8217;m building for him should be using this technique for interacting with a database. In this case, the answer is a resounding no since [...]]]></description>
			<content:encoded><![CDATA[<p>Version 5 of MySQL added Stored Procedures and, as is often the case when you&#8217;ve been using earlier versions, I didn&#8217;t notice at all, until a client asked whether the site I&#8217;m building for him should be using this technique for interacting with a database. In this case, the answer is a resounding <strong>no </strong>since it would add an unnecessary level of complexity to a site in which the MySQL queries rarely involve more than one table at a time.</p>
<p>So, when should they be used?</p>
<p><span id="more-699"></span></p>
<p>A Stored Procedure is, as its name suggests, a series of SQL statements saved for use later, sort of like an old fashioned .bat Batch file on steroids. They&#8217;re particularly useful where you have a complex sequence of actions that never changes: you can get it right once and then run it with much lower overheads in future.</p>
<p>I&#8217;ve also heard claims that Stored Procedures improve security against SQL Injection but it&#8217;s hard to see why where dynamic data is concerned and, after all, PHP includes <strong>mysql_real_escape_string</strong> which protects against this form of attack.</p>
<p>So, it seems to me that Stored Procedures would be useful for busy sites with repetitive actions (for example interfacing a shopping cart with a stock management system) but do they have uses for more typical web applications? Or would you suggest that they should be used for every SQL query?</p>
<p>I really don&#8217;t know where the line should be drawn: at the extremes it&#8217;s pretty clear but the line is extremely fuzzy. Any thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2008/05/18/when-to-use-stored-procedures/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

