Bug #17068 Updated: MSSQL fails to open a SP using a cursor on query that contains an expression
| From: | derick@php.net | Date: | Tue, 07 May 2002 09:35:59 +0000 |
| Subject: | Bug #17068 Updated: MSSQL fails to open a SP using a cursor on query that contains an expression | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7131@lists.php.net to get a copy of this message | ||
ID: 17068
Updated by: derick@php.net
Reported By: jasonh@trurocollege.ac.uk
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: WinNT 5.0
PHP Version: 4.2.0
New Comment:
Cursors are broken in 4.2.0, it is fixed in 4.2.1-dev. To test yourself
can a stable snapshot from snaps.php.net/win32, or wait for 4.2.1 which
will be released next week.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-05-07 05:32:22] jasonh@trurocollege.ac.uk
The MSSQL extension fails to even open (using mssql_query) a query on a
stored procedure that uses a cursor on a query containing an
expression. The following SP works fine in Query Analyser (MSSQL7) but
will not get past the mssql_query line in PHP. The occurrence of the
expression "id + 1" is, bizarrely, the apparent cause of the problem.
Changing this to just "id" makes it all work from PHP.
------------
CREATE PROCEDURE TestCursor AS
--This makes no difference:
-- set nocount on
declare c scroll cursor for
select id + 1 as newid from table
open c
fetch next from c
while (@@fetch_status = 0)
fetch next from c
close c
deallocate c
-- set nocount off
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17068&edit=1