#42076 [Opn->Fbk]: PDO_ODBC: Return parameters of stored procedure
| From: | jani@php.net | Date: | Sat, 25 Apr 2009 14:46:19 +0000 |
| Subject: | #42076 [Opn->Fbk]: PDO_ODBC: Return parameters of stored procedure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136259@lists.php.net to get a copy of this message | ||
ID: 42076
Updated by: jani@php.net
Reported By: ydiazc at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Win XP
PHP Version: 5.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2007-08-01 13:05:36] aballard at gmail dot com
Sorry for the last. I must have hit a key to submit the post before I
finished typing.
Anyway, I have observed similar problems using stored procedures in SQL
server using the Microsoft SQL ODBC driver from PHP 5.2.0 and 5.2.3 on
both a development PC running Windows XP and a server running Windows
Server 2003.
I have observed that output parameters do not alter bound variables if
the procedure has more than one parameter. (The examples shown in the
PDO manual work, as they each have only one parameter.)
I have also found that the data type MUST include
PDO::PARAM_INPUT_OUTPUT, AND that the presence/absence of a value for
length seems to override PDO::PARAM_INPUT_OUTPUT, at least internally.
Basically, if a value is specified for length, the parameter is sent to
SQL server as an OUTPUT parameter even if it is not defined as such in
the procedure.
------------------------------------------------------------------------
[2007-07-23 07:26:06] ydiazc at gmail dot com
Description:
------------
On the stores procedures not returned parameter of output or input
output with php pdo and driver ODBC in both cases (sql server and
oracle), is idem for both databases
PDO('odbc:Driver={Microsoft ODBC for Oracle}...
PDO('odbc:Driver={SQL Native Client}...
the parameters of input or input output, They enter without problems
to
store procedure, But they do not go out with value MODIFY of
procedure.
help me !!!, I need to use multiple engines.
Thank you for his help
Reproduce code:
---------------
CREATE PROCEDURE "BDSALUD"."PARAM" (Nombre IN OUT VARCHAR2)
IS
BEGIN
INSERT INTO REGISTRY name,value)VALUES (Nombre,777);
Nombre:='RONI';
END;
$stmt = $db->prepare("CALL PARAM(:Nombre)");
$Nombre = 'hello';
$stmt->bindParam(':Nombre', $Nombre,
PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
$resultado= $stmt->execute();
echo "<p>resultado: ".$resultado;
echo "<p>Nombre: ".$Nombre;
Expected result:
----------------
resultado: 1
Nombre: RONI
Actual result:
--------------
resultado: 1
Nombre: hello
(THE INSERT WAS DONE, BUT NOT MODIFIED $Nombre)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42076&edit=1