次の行を含む非常に単純な Perl スクリプトを作成しました。
my $q_it = $dbh->prepare('SELECT customdata.Field_ID,
customdata.Record_ID,
customdata.StringValue
FROM customdata
WHERE customdata.Field_ID='\'10012'\' && (StringValue LIKE '\'1%'\' OR StringValue LIKE '\'2%'\' OR StringValue LIKE '\'9%'\');
');
customdata はテーブルです。
ただし、「WHERER」句について不平を言う構文エラーが常に発生しました。
Backslash found where operator expected at /home/wblocaladmin/Robert_2.pl line 18, near "'10012'\"
引用文内の引用なので、上記のようにシングルクォートをエスケープしてみました。どこが間違っていたのかを特定するのを手伝ってくれる人はいますか?
ありがとう!