Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
… my $string = ${middle}."%".', '.${last}.', '.${first}; my $sql = ” SELECT MIDDLE, LAST, FIRST FROM mytable WHERE MIDDLE like ? AND LAST = ? AND FIRST = ? order by FIRST asc” my $sth = $dbh->prepare($sql) or die "Prepare Error: $DBI::errstr"; $sth->execute($string) or die "SQL Error: $DBI::errstr\n"; …
Some how it treats the values in “$string” as one, is there a way of doing this?called with 1 bind variables when 3 are needed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Values concatenation for SQL query
by LanX (Saint) on Mar 10, 2015 at 12:11 UTC | |
by Anonymous Monk on Mar 10, 2015 at 12:28 UTC | |
by Corion (Patriarch) on Mar 10, 2015 at 12:33 UTC | |
by LanX (Saint) on Mar 10, 2015 at 12:36 UTC | |
|
Re: Values concatenation for SQL query
by KurtSchwind (Chaplain) on Mar 10, 2015 at 12:33 UTC | |
by Anonymous Monk on Mar 10, 2015 at 12:42 UTC |