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

Bug #104 query() does not return bind variable in stored procedure call
Submitted: 2003-10-15 15:26 UTC
From: blazicek at bof dot sk Assigned: danielc
Status: Bogus Package: DB
PHP Version: 4.3.3 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2004-01-16 17:51 UTC
Package:
Bug Type:
Summary:
From: blazicek at bof dot sk
New email:
PHP Version: Package Version: OS:

 

 [2003-10-15 15:26 UTC] blazicek at bof dot sk
Description: ------------ No value is returned to bind variable, when calling stored procedure, which returns value in parameter. Connect type: OCI8 Reproduce code: --------------- $tmp = ' '; $query = "BEGIN test('param1',?); END;"; $res = $this->db->query($query, &$tmp); PROCEDURE TEST(param in varchar2, param2 OUT VARCHAR2) IS BEGIN ... param2 := 'something'; ... END; Expected result: ---------------- 'something' in $tmp Actual result: -------------- $tmp is unchanged It can be solved by adding & in common.php on line 758 $ret = $this->execute($sth, &$params); When $params are passed by reference, it works fine.

Comments

 [2004-01-15 02:11 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-01-16 13:47 UTC] blazicek at bof dot sk
diff output is as follows diff -u -r1.49 common.php --- DB/common.php 16 Jan 2004 04:21:00 -0000 1.49 +++ DB/common.php 16 Jan 2004 13:26:21 -0000 @@ -773,7 +773,7 @@ if (DB::isError($sth)) { return $sth; } - $ret =& $this->execute($sth, $params); + $ret =& $this->execute($sth, &$params); $this->freePrepared($sth); return $ret; } else { @@ -1546,4 +1546,4 @@ * End: */ -?> +?> \ No newline at end of file and with following sources you can reproduce the bug <? require_once 'DB.php'; $db = DB::connect('oci8://www:www@mark', TRUE); $tmp = array(" "); $query = "BEGIN test('param1',?); END;"; $res = $db->query($query, &$tmp); var_dump($tmp); ?> CREATE OR REPLACE PROCEDURE WWW.TEST ( param1 IN varchar2, param2 IN OUT varchar2) IS BEGIN param2 := 'something'; END; -- Procedure output before array(1) { [0]=> string(28) " " } output after change array(1) { [0]=> &string(9) "something" }
 [2004-01-16 17:51 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!