<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Mike McGonagle</b> &lt;<a href="mailto:mjmogo@gmail.com">mjmogo@gmail.com</a>&gt;<br>Date: Dec 10, 2007 1:07 PM
<br>Subject: Re: [PD] [psql] object hand-holding<br>To: <a href="mailto:jamie@postlude.co.uk">jamie@postlude.co.uk</a><br><br></span><br><br><div><span class="q"><span class="gmail_quote">On 12/10/07, <b class="gmail_sendername">
Jamie Bullock</b> &lt;<a href="mailto:jamie@postlude.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jamie@postlude.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">

Good point! I think Hans&#39; recent suggestion addresses the problem. It<br>also occurs to me that for Postgres at least, we have the PREPARE<br>statement, which addresses the optimisation and injection issues you<br>have raised. Technically [psql] already supports PREPARE except that
<br>PREPARE uses the &#39;$&#39; character as its placeholder identifier, and &#39;$1&#39;<br>can&#39;t be passed around as a symbol in Pd. I think it might be<br>interesting to use the &#39;?&#39; notation currently under discussion as an
<br>interface to PREPARE though.</blockquote><div><br>&nbsp;</div></span><div>One of the things that I have been reading on this is that when you use these &#39;pre-complied&#39; SQL statements, you need to &#39;bind&#39; each of the variables with their types to a specific function. (Also, I kind of like the &#39;:&#39; syntax, as it puts a name to the data within the statement.) I also think that we would need to do something like
</div><div><br>&nbsp;</div><div>[insert into table (id, name) values (:id, :name) ( &lt;-- sent to the cold inlet</div><div>[bind :id float( &lt;-- sent to hold inlet</div><div>[bind :name symbol(&nbsp;&lt;-- sent to hold inlet
</div><div><br>&nbsp;</div><div>[:id 1 (&nbsp;&lt;-- sent to hold inlet</div><div>[:name john (&nbsp;&lt;-- sent to hold inlet</div><div>[bang (&nbsp;&lt;-- sent to hold inlet</div><div><br>
</div><div>and then we would be able to put all the data into the database with the expected types. At least SQLite and libdbi use these &#39;bind&#39; functions to associate the expected datatype with the input data.</div>
<span class="sg">
<div><br>&nbsp;</div><div>Mike</div></span><span class="q"><div><br>&nbsp;</div><div>&nbsp;</div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Jamie<br><br>--<br><a href="http://www.postlude.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.postlude.co.uk</a><br><br><br>_______________________________________________<br><a href="mailto:PD-list@iem.at" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
PD-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -&gt; 
<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.puredata.info/listinfo/pd-list</a><br></blockquote></span></div><br><br clear="all">
<div><span class="e" id="q_116c57447c4d2aa6_6"><br>-- <br>Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal.
<br>—Yehudi Menuhin (1916–1999), musician
</span></div><br clear="all"><br>-- <br>Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal.<br>—Yehudi Menuhin (1916–1999), musician