$stg = $dbh->prepare(
'SELECT REFERENCE, REQUIREMENT FROM TestCasesOutput WHERE PassFail =
+ \'FAIL\''
);
or
$stg = $dbh->prepare(
"SELECT REFERENCE, REQUIREMENT FROM TestCasesOutput WHERE PassFail =
+ 'FAIL'"
);
The problem was that only single quotes should be used to denote string literals in SQL. "Some Name" may be either a string or the name of a column or other object. Which is it depends on the database and its settings, but the later meaning is much more likely.
I believe you got the misleading error message because Access tries to be helpfull and treats unknown column names as "query parameters". If you would run that query from within Access you'd get a popup dialog asking you to enter the value of "FAIL".
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
|