|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46008 odbc_execute throws sql error code 01S02.
Submitted: 2008-09-06 14:00 UTC Modified: 2008-09-06 17:16 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jiunarayan at gmail dot com Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 5.2.6 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jiunarayan at gmail dot com
New email:
PHP Version: OS:


 [2008-09-06 14:00 UTC] jiunarayan at gmail dot com
I wanted to get the stored procedure of SQL Server2000 using odbc driver.My system configuration is Linux where I used freeTDS to connect to odbc, PHP version 5.2. I used the odbc_prepare() and odbc_execute() method to access the stored procedure but it throws the SQL error code 01S02.  I have tried in many ways to solve this out but I failed. Can anyone help me out????? Has any one called the stored procedures of SQL Server2000 using odbc, in Linux???? 

Reproduce code:
$con = odbc_connect($dsn,$user,$pwd,SQL_CUR_USE_ODBC )or die("couldn't connect\n");
echo "connected TO DB  ***";
$stmt = odbc_prepare($con,'CALL phptestproc') or die("failed odbc_prepare\n");
echo "\nodbc_prepare ***".$stmt;
 $a = array("India",1000);
$success = odbc_execute($stmt,$a)or die("error in odbc_execute");
echo "Successfully added into the database"

Expected result:
The stored procedure in SQL Server2000-[ phptestproc =ALTER  procedure phptestprocnew @name varchar(20),@age int
as insert into phptest values(@name,@age)  ] gets successfully updated

Actual result:
connected TO DB  ***
odbc_prepare ***Resource id #2<br />
<b>Warning</b>:  SQL error: [unixODBC][Driver Manager]Option value changed, SQL state 01S02 in SQLExecute in <b>/home/projects/php_project/aphp.php</b> on line <b>18</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-06 17:16 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 01:05:44 2022 UTC