ID:               13195
 Updated by:       [EMAIL PROTECTED]
 Reported By:      martinrosenauer at hotmail dot com
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      4.0.6
 New Comment:

There are now a number of native drivers that explicitly support OUT
parameters from stored procedures; for your particular example, the
ibm_db2 extension in PECL (http://pecl.php.net/ibm_db2, with docs
available at http://php.net/ibm_db2) supports OUT parameters for DB2,
Cloudscape, and Apache Derby databases beginning with PHP 4.3.11 and
higher (including PHP 5.0/5.1).

Apparently the challenge with making this support available in the
Unified ODBC extension is that the specific requirements vary so much
by database that it is next to impossible to extend support for every
feature for every database in the Unified ODBC extension -- therefore,
the mssql extension supports OUT parms for MS SQL Server, the OCI8
extension supports OUT parms for Oracle, the ibm_db2 extension supports
OUT parms for DB2, etc. 

Note that the PDO_ODBC driver for the PHP Data Objects (PDO) extension
does support OUT parms for DB2 natively, as well as other databases
that offer ODBC drivers. PDO requires PHP 5.0 and above.

So I'm closing this as "Won't fix", noting that there are better
alternatives than the Unified ODBC extension for this functionality.


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

[2004-07-21 10:51:07] nicolas dot karageuzian at clubmed dot com

Hi, we tried the following example :
<?php
  $proc_qry = "CALL CM.CLIBROS(? , ? , ?)";
  $dbconn = dbconnect();
  $proc_stmt = odbc_prepare($dbconn,$proc_qry);
  $codFon = 0;
  $codPYC = "010";
  $codRet = "";
  $values = array ($codFon,$codPYC,$codRet);
  $result = odbc_execute($proc_stmt,$values) ;
  while(odbc_fetch_row($result)){
    for($i=1;$i<=odbc_num_fields($result);$i++){
       echo "colonne ".i." : ".odbc_result($result,$i);
    } //for
  } //while

the third parameter of CLIBROS stored procedure is an output parameter.
PHP reported this error :
 [error] PHP Warning:  odbc_execute(): SQL error: [IBM][CLI Driver]
CLI0005W  Option value changed. SQLSTATE=01S02, SQL state 01S02 in
SQLExecute in testPRS.php on line 31

we didn't find how to register an output parameter for the statement.

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

[2001-09-07 11:23:23] martinrosenauer at hotmail dot com

As of now the odbc-wrapper, for example used with DB2 databases,
support calling stored procedures. It supports IN parameters used with
stored procedures as well, but not OUT parameters (meaning you can get
parameters returned to PHP when calling a stored procedure). 

This is for example possible when using Perl and DBI (against DB2). The
method there that enables it is called Bind (where you bind a var to an
out parameter). Unfortunately this method is not available as
odbc_bind. 

If this is by any chance possible I'd be more than happy!

I had a brief dialog with Frank Kromann ([EMAIL PROTECTED]), who was
involved with the ODBC wrapper implementation and he confirmed that a
binding or OUT parameter support was already there.

Best regards and thanks a mill,

Martin Jacobsen, Denmark

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


-- 
Edit this bug report at http://bugs.php.net/?id=13195&edit=1

Reply via email to