|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-05 22:42 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 17:00:01 2025 UTC |
Description: ------------ Zend_Db: When executing stored procedure on SQL Server from loop, subsequent queries in loop return Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 20019 Attempt to initiate a new SQL Server operation with results pending. [20019] Current workaround is to reconnect after each loop iteration, which is expensive. Reproduce code: --------------- $db = $this->getAdapter(); foreach($data as $k => $v){ $sql = "EXECUTE sp_DoSomething {$db->quote($k)}, {$db->quote($v)}"; $result = $db->query($sql)->fetchAll(); } Expected result: ---------------- Successful execution of stored procedure during each loop iteration. Actual result: -------------- First execution in loop succeeds, but subsequent executions return Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 20019 Attempt to initiate a new SQL Server operation with results pending. [20019]