ID:               42076
 Comment by:       aballard at gmail dot com
 Reported By:      ydiazc at gmail dot com
 Status:           Open
 Bug Type:         PDO related
 Operating System: WINDOW XP
 PHP Version:      5.2.3
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2007-08-01 12:55:52] aballard at gmail dot com

I have observed similar problems using stored procedures in SQL server
using the Microsoft SQL ODBC driver on both Windows XP

------------------------------------------------------------------------

[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

Reply via email to