Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #10969 MDB2_Statement_oci8::_execute() does not bind reference variables
Submitted: 2007-05-07 14:48 UTC
From: c01234 Assigned: quipo
Status: Closed Package: MDB2_Driver_oci8 (version 1.4.1)
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-05-07 14:48 UTC] c01234 (Chuckie Wood)
Description: ------------ Line 1421 of MDB2/Driver/oci8.php is currently: if (!@OCIBindByName($this->statement, ':'.$parameter, $quoted_values[$i])) { But $quoted_values is a local variable. I want to be able to use the variables that I passed by reference using bindParam(). I would like it changed to something like this: $this->values[$parameter] = $quoted_values[$i]; if (!@OCIBindByName($this->statement, ':'.$parameter, $this->values[$parameter])) { so that OCIBindByName uses the variable that I passed by reference when I called bindParam(), or else a SQL RETURNING clause is useless Test script: --------------- // $dsn = ... // $options = ... $mdb2 =& MDB2::connect($dsn, $options) $ho_stmt =& $mdb2->prepare( 'INSERT INTO test(apk) VALUES(seq_apk.NEXTVAL) RETURNING apk INTO :apk'); $ho_stmt->bindParam("apk", $apk, "integer"); $ho_stmt->execute(); echo $apk; // $apk is null but it should be the value of // the 'apk' field of the record just inserted Expected result: ---------------- echoes the value of the 'apk' field of the record just inserted Actual result: -------------- echoes null

Comments

 [2007-07-01 17:09 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.