Well, if someone has a better solution, let him introduce it or perhaps tell me what might be wrong in my workaround. I replace all the "?" with ": autoparam" with a parameter increment creating ": autoparam0", ": autoparam1", ": autoparam2", etc.
//Replace ? with a pseudo named parameter $newStatement = null; $parameter = 0; while($newStatement !== $statement) { if($newStatement !== null) { $statement = $newStatement; } $newStatement = preg_replace('/\?/', ':autoparam'.$parameter, $statement, 1); $parameter++; } $statement = $newStatement;
Then, when I get a request to bind a parameter from PDO, I check if this parameter is numeric. In most languages, as far as I know, numeric indices are invalid identifiers, so I can safely assume, at least for my driver for Windows PDO, to replace the name of the numeric parameter:
//Replace the first @oci8param to a pseudo named parameter if(is_numeric($parameter)) { $parameter = ':autoparam'.$parameter; }
This works now, I need to do more tests with laravel to see if the problem appears in a different score, but so far it seems complete ...
Mathieu dumoulin
source share