php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30474 You cannot send any query until last procedure' all results are read.
Submitted: 2004-10-18 20:18 UTC Modified: 2005-01-18 17:19 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: pawel at pawelgorny dot com Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 4.3.9 OS: Windows 2000
Private report: No CVE-ID: None
 [2004-10-18 20:18 UTC] pawel at pawelgorny dot com
Description:
------------
I work on SQL SERVER 2000.
When You do odbc_connect() and query 'SELECT', it returns a few rows. In every moment You may stop read it and send another query. But if first You send query 'EXEC MyProcedure', You have to wait until all rows are read. If you send a query, there is an error [ODBC DRIVER - Busy].
What is problem: If I run a procedure which returns some rows, and for every row I want to make something other in base (INSERT in other table etc) there is an error. I can't do anything until the whole procedure' result is read.
This error doesn't appear for 'SELECT' - not 'EXEC procedure'

Reproduce code:
---------------
OK:
$id=odbc_connect();
$sql='exec something';
$res=odbc_exec($id,$sql);
while ($row=odbc_fetch_object($res))
{something}
$sql='exec something';
$res=odbc_exec($id,$sql);

ERROR:
$id=odbc_connect();
$sql='exec something';
$res=odbc_exec($id,$sql);
$sql2='exec somethingDiffernet';
$res2=odbc_exec($id,$sql2);

ERROR:
$id=odbc_connect();
$sql='exec something';
$res=odbc_exec($id,$sql);
$id2=odbc_connect();
$sql2='exec somethingDiffernet';
$res2=odbc_exec($id2,$sql2);

Expected result:
----------------
I want to run second (and next) queries (procedures) without waiting for full-read first results.

Actual result:
--------------
[Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt [#0]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-18 17:19 UTC] tony2001@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. 

Thank you for your interest in PHP.

Not PHP problem - Microsoft ODBC driver doesn't support multiple active statements on the same connection.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC