php.net |  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
Votes:1
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jiunarayan at gmail dot com
New email:
PHP Version: OS:

 

 [2008-09-06 14:00 UTC] jiunarayan at gmail dot com
Description:
------------
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:
---------------
<?php
$dsn="MSSQLTestServer";
$user="sa";
$pwd="sysadmin";
$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");
odbc_commit($con);
odbc_close($con);
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 />


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-06 17:16 UTC] tularis@php.net
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 http://www.php.net/support.php 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-2020 The PHP Group
All rights reserved.
Last updated: Sat Apr 04 10:01:25 2020 UTC