<?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: SQL queries with varidic argument lists</title>
	<atom:link href="http://www.rakkar.org/blog/?feed=rss2&#038;p=360" rel="self" type="application/rss+xml" />
	<link>http://www.rakkar.org/blog/?p=360</link>
	<description>Trials of a game developer</description>
	<lastBuildDate>Tue, 20 Jul 2010 22:23:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Oliver Smith</title>
		<link>http://www.rakkar.org/blog/?p=360&#038;cpage=1#comment-14916</link>
		<dc:creator>Oliver Smith</dc:creator>
		<pubDate>Mon, 25 Aug 2008 17:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.rakkar.org/blog/?p=360#comment-14916</guid>
		<description>e.g. from the Perl &lt;a href=&#039;http://search.cpan.org/~timb/DBI-1.607/DBI.pm&#039; rel=&quot;nofollow&quot;&gt;DBI man page&lt;/a&gt;:

       &lt;b&gt;Placeholders and Bind Values&lt;/b&gt;

       Some drivers support placeholders and bind values.  Placeholders, also
       called parameter markers, are used to indicate values in a database
       statement that will be supplied later, before the prepared statement is
       executed.  For example, an application might use the following to
       insert a row of data into the SALES table:

         INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)

       or the following, to select the description for a product:

         SELECT description FROM products WHERE product_code = ?

       The &quot;?&quot; characters are the placeholders.  The association of actual
       values with placeholders is known as binding, and the values are
       referred to as bind values.  Note that the &quot;?&quot; is not enclosed in
       quotation marks, even when the placeholder represents a string.
</description>
		<content:encoded><![CDATA[<p>e.g. from the Perl <a href='http://search.cpan.org/~timb/DBI-1.607/DBI.pm' rel="nofollow">DBI man page</a>:</p>
<p>       <b>Placeholders and Bind Values</b></p>
<p>       Some drivers support placeholders and bind values.  Placeholders, also<br />
       called parameter markers, are used to indicate values in a database<br />
       statement that will be supplied later, before the prepared statement is<br />
       executed.  For example, an application might use the following to<br />
       insert a row of data into the SALES table:</p>
<p>         INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?)</p>
<p>       or the following, to select the description for a product:</p>
<p>         SELECT description FROM products WHERE product_code = ?</p>
<p>       The &#8220;?&#8221; characters are the placeholders.  The association of actual<br />
       values with placeholders is known as binding, and the values are<br />
       referred to as bind values.  Note that the &#8220;?&#8221; is not enclosed in<br />
       quotation marks, even when the placeholder represents a string.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver Smith</title>
		<link>http://www.rakkar.org/blog/?p=360&#038;cpage=1#comment-14914</link>
		<dc:creator>Oliver Smith</dc:creator>
		<pubDate>Mon, 25 Aug 2008 17:40:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.rakkar.org/blog/?p=360#comment-14914</guid>
		<description>Isn&#039;t %c the &quot;single character&quot; mask?

I haven&#039;t used PG in a long time, but normally you &quot;prepare&quot; the query; the standard interface is usually something like this:

 db = databaseConnection() ;
 sth = prepareStatement(&quot;INSERT INTO table (xval, yval, strval, dataval) VALUES (?, ?, ?, ?)&quot;) ;
 db-&gt;execute(sth, arg1, arg2, arg3, arg4) ;

It&#039;s always preferable to try and avoid passing data to the SQL parser even if for no reason other than it&#039;s more efficient to pass it a placeholder/token instead of your data in terms of time it takes to process.</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t %c the &#8220;single character&#8221; mask?</p>
<p>I haven&#8217;t used PG in a long time, but normally you &#8220;prepare&#8221; the query; the standard interface is usually something like this:</p>
<p> db = databaseConnection() ;<br />
 sth = prepareStatement(&#8220;INSERT INTO table (xval, yval, strval, dataval) VALUES (?, ?, ?, ?)&#8221;) ;<br />
 db-&gt;execute(sth, arg1, arg2, arg3, arg4) ;</p>
<p>It&#8217;s always preferable to try and avoid passing data to the SQL parser even if for no reason other than it&#8217;s more efficient to pass it a placeholder/token instead of your data in terms of time it takes to process.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
