<?xml version="1.0" encoding="windows-1252"?>
<node id="930061" title="Re^5: Variable interpolation in a file to be read in" created="2011-10-06 16:21:27" updated="2011-10-06 16:21:27">
<type id="11">
note</type>
<author id="747201">
afoken</author>
<data>
<field name="doctext">
&lt;dl&gt;
&lt;dt&gt;[id://907862]&lt;/dt&gt;
&lt;dd&gt;Problem 1: "&lt;c&gt;limit ?&lt;/c&gt;" with [mod://DBD::mysql]. Seems to be a bug introduced in some version of DBD::mysql. Maybe the placeholder support for &lt;c&gt;limit&lt;/c&gt; was an accidental feature removed by a "bugfix", but as this "bugfix" breaks existing code, it is a bug, not a bugfix. Maybe it is related to changed placeholder handling code in 4.014 / 4.015, and maybe it could be fixed using the &lt;c&gt;mysql_bind_comment_placeholders&lt;/c&gt; attribute. Or it was broken in 3.0008_1, when the LIMIT parsing was changed. I don't know, I don't like MySQL, and so I don't use it.&lt;/dd&gt;
&lt;dd&gt;Problem 2: Datetime literals with [mod://DBD::ODBC]. Seems to be caused by using an incompatible datetime format in the application, according to [id://907945|the reply] by [id://492557], the maintainer of DBD::ODBC.&lt;/dd&gt;
&lt;dt&gt;[id://174709]&lt;/dt&gt;
&lt;dd&gt;Problem 3: "&lt;c&gt;col like ?&lt;/c&gt;" instead of "&lt;c&gt;col like 'prefix%'&lt;/c&gt;" forces Oracle's query optimizer into a full table scan, because it can no longer see the special case that only col values starting with &lt;c&gt;prefix&lt;/c&gt; are relevant and thus an index on &lt;c&gt;col&lt;/c&gt; can be used. When I learned to use Oracle, I was told to avoid &lt;c&gt;like&lt;/c&gt; when &lt;c&gt;substr&lt;/c&gt; can be used. I have no Oracle instance available, but I think the query optimizer should be able to use the index with "&lt;c&gt;substr(col,1,length(:p1))=:p1&lt;/c&gt;".&lt;/dd&gt;
&lt;dt&gt;[id://667081]&lt;/dt&gt;
&lt;dd&gt;Problem 4: "&lt;c&gt;col in (&lt;/c&gt;&lt;i&gt;list&lt;/i&gt;&lt;c&gt;)&lt;/c&gt;". Yeah. SQL sucks here. This is not a DBI problem. You have to construct a different SQL statement for each different list length. And in parallel, you can/have to construct a list of parameters to be passed to &lt;c&gt;$sth-&gt;bind_param()&lt;/c&gt; or &lt;c&gt;$sth-&gt;execute()&lt;/c&gt;. Or, you use a wrapper to do so: [id://646155]'s [id://686282|reply] proposes to use the special "??" placeholder of [mod://DBIx::Simple].&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;I still see no reason to use &lt;c&gt;quote()&lt;/c&gt; in all but the first case. And even this "limit" problem would better be fixed by reconfiguring or reparing DBD::mysql, or by downgrading it to the latest "known good" version.&lt;/p&gt;
&lt;p&gt;Alexander&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-747201"&gt;
--&lt;br&gt;
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
930008</field>
<field name="parent_node">
930043</field>
</data>
</node>
