perlquestion
jfroebe
<p>AFAIK, you can't use a placeholder with a SQL like statement. A coworker says you can. Can anyone confirm or deny it?</p>
<code>$query = 'select name from my_table where name like ?%';
my $sth = $dbh->prepare($query);
$sth->execute('Jo');</code>
<p>Basically he is convinced that you can. Nothing I've shown him has convinced him otherwise. Hopefully some prince or princess of the Perl Monks can break this stalemate</p>
<p><strong>UPDATE:</strong></p>
<p>poj pointed out that I was incorrect. The percent sign belongs in the execute() not the prepare query.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-304796">
<p>Jason L. Froebe</p>
<p><a href="http://jfroebe.livejournal.com">Blog</a>, <a href="http://www.froebe.net/blog">Tech Blog</a></p>
</div></div>