php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42076 PDO_ODBC: Return parameters of stored procedure
Submitted: 2007-07-23 07:26 UTC Modified: 2009-05-03 01:00 UTC
Votes:5
Avg. Score:3.8 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:2 (50.0%)
From: ydiazc at gmail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.3 OS: Win XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-07-23 07:26 UTC] 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)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-01 13:05 UTC] 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.
 [2009-04-25 14:46 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 18:01:34 2024 UTC