Clifford Meece wrote:
I have a script that calls:
$sth=$dbh->prepare(qq{select acctId from accounts where
acctNum='$acctNum' and subAcct=NULL});
This command works fine from the msql command propt(with $acctNum
replaced with an actual value) but fails from my perl script with the
error:
DBD::mSQL::st execute failed: parse error at line 2 near "= *end of
input*" at ./findacct.new line 70.
What's $acctNum? Is it possible that it includes NUL bytes, single
quotes or something else?
If it doesn't include NUL bytes, you should never use '$acctNum', but
$dbh->quote($acctNum).
If it includes NUL bytes, forget about mSQL: It cannot deal with that.
Bye,
Jochen