<?xml version="1.0" encoding="windows-1252"?>
<node id="1012125" title="Re: DBI indexable placeholder" created="2013-01-07 17:49:49" updated="2013-01-07 17:49:49">
<type id="11">
note</type>
<author id="647953">
sundialsvc4</author>
<data>
<field name="doctext">
&lt;p&gt;
I had to do something vaguely-similar to this once, and what I decided to do was to define each SQL-statement definition (there were hundreds of them) as consisting of SQL text, with the appropriate placeholders, &lt;em&gt;and&lt;/em&gt; a separate list of parameter-names, which were taken from a list of &lt;tt&gt;(use) constant&lt;/tt&gt;s. &amp;nbsp; The number of entries in the parameter-name list had to exactly match the number of placeholders in the query definition (which was basically hard-coded into the app). &amp;nbsp; Anyhow, to run a query you specified the name of the query and a &lt;em&gt;hash&lt;/em&gt; of named parameters. &amp;nbsp; When building the DBI request, the (positional...) parameters were resolved by name ... by my Perl code, before running the query. &amp;nbsp; It was easy to write and worked very well in practice. 
&lt;/p&gt;&lt;p&gt;
I freely admit that I find the notion of a &lt;tt&gt;:&lt;i&gt;name&lt;/i&gt;&lt;/tt&gt; syntax to be quite intriguing, and instantly see how such a thing could be &lt;em&gt;generally&lt;/em&gt; implemented (even to the point of idly wondering if it could be a Perl fee-chur, maybe through some mix-in package?). &amp;nbsp; It would have been an improvement over my original idea to be sure.
&lt;/p&gt;
</field>
<field name="root_node">
1011687</field>
<field name="parent_node">
1011687</field>
</data>
</node>
