jfroebe has asked for the wisdom of the Perl Monks concerning the following question:
AFAIK, you can't use a placeholder with a SQL like statement. A coworker says you can. Can anyone confirm or deny it?
$query = 'select name from my_table where name like ?%'; my $sth = $dbh->prepare($query); $sth->execute('Jo');
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
UPDATE:
poj pointed out that I was incorrect. The percent sign belongs in the execute() not the prepare query.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBI placeholders and like statement
by poj (Abbot) on Jun 18, 2013 at 17:00 UTC | |
by jfroebe (Parson) on Jun 18, 2013 at 17:08 UTC | |
by runrig (Abbot) on Jun 18, 2013 at 20:16 UTC | |
by erix (Prior) on Jun 19, 2013 at 21:26 UTC | |
by jfroebe (Parson) on Jun 19, 2013 at 17:48 UTC | |
by Tanktalus (Canon) on Jun 18, 2013 at 23:02 UTC |
Back to
Seekers of Perl Wisdom