I'm using Zend_Db with an Oracle adapter, and I'm trying to execute a query with an IN()
statement in the WHERE
clause.
The statement does not generate any errors, but also does not execute the update. I've tried the following forms:
$arrLinesCanceled = array('0000000001', '0000000002');
// attempt 1
$db->query(
"UPDATE my_table SET STATUS = :status WHERE id IN(:lineIds)",
array(
'lineIds' => $arrLinesCanceled,
'status' => 'C',
))->execute();
// attempt 2 (this actually errors out with 'not all parameters are bound')
$db->query(
"UPDATE my_table SET STATUS = :status WHERE id IN(:lineIds)"
)->execute(array(
'lineIds' => $arrLinesCanceled,
'status' => 'C',
));
// attempt 3
$stmtUpdateDetailStatus = $db->prepare(
"UPDATE my_table SET STATUS = :status WHERE id IN(:lineIds)");
$stmtUpdateDetailStatus->execute(array(
'lineIds' => $arrLinesCanceled,
'status' => 'C',
));
// last, very desperate attempt
$db->query("UPDATE my_table SET STATUS = :status WHERE id IN(:lineIds)", array(
':lineIds' => $arrLinesCanceled,
':status' => 'C',
))->execute(array(
':lineIds' => $arrLinesCanceled,
':status' => 'C',
));
to be sure the input in correct, here's an actual print_r
of the $arrLinesCanceled
Array( [0] => 6617 [1] => 6618)
Is this not supported by Oracle 11 or the Zend_Db adapter? I can't see what could be wrong...