|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41329 Lack of ability to bind output parameters in PHP Unified ODBC functions
Submitted: 2007-05-08 17:58 UTC Modified: 2016-12-31 00:12 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: alantak at uchicago dot edu Assigned:
Status: Open Package: ODBC related
PHP Version: 5.2.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: alantak at uchicago dot edu
New email:
PHP Version: OS:


 [2007-05-08 17:58 UTC] alantak at uchicago dot edu
It would be fantastic if one could use the Unified ODBC functions to bind output parameters. We would like to be able to simply odbc_prepare any and all SQL Server queries we run in our PHP code as a best practice.

The only info I've found is an old message saying to use mssql_* functions instead. Well, those are limiting in their own ways (FreeTDS), and having to switch between the two in order to handle all queries is not very practical/convenient/clean/elegant/managable/maintainable/etc.

The old message also said that there are no plans to implement this since it is complicated and DBMS dependent. Is this still the stance PHP is taking?

Having worked with the odbc driver vendor we feel certain that this is an issue with the Unified ODBC functions.

Reproduce code:
$dbh = odbc_connect($dsn,$DSN_USER,$DSN_PASS) or exit("cannot connect!");

$sql = "                                                                                                              
    DECLARE @returncode INT;                                                                                          
    @returncode =  {CALL  [dbo].[alan_test_proc](?, ?, ?, ?, ?)};                                                     
    SELECT @returncode as returncode;                                                                                 

$data = array("testtext", "4", "2006-03-01", "1", "1.34");

$prepared = odbc_prepare($dbh, $sql) or exit ("Cannot prepare.");

$result = odbc_execute($prepared, $data) or exit("Cannot exec.");

print "errorcode: ".odbc_result($prepared, 'errorcode');



Expected result:
In this case the stored procedure will return a 0 or a 1. I can provide the SQL code in the stored procedure if necessary.

Actual result:
SQL error: [DataDirect][ODBC SQL Server Driver]COUNT field incorrect, SQL state 07001 in SQLExecute


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:12 UTC]
-Package: Feature/Change Request +Package: ODBC related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 21 09:01:30 2024 UTC