Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor as an OUTPUT parameter
Message
From
21/07/2003 05:25:45
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00811406
Message ID:
00811945
Views:
12
No, Sergey, CURSOR_CLOSE_ON_COMMIT was OFF, i checked it with sp_dboption and the set it explicitely to OFF, result was the same (error).
I've got MS SQL 2000 by the way.
Maybe you have a couple of stored procedures which successfully exchange data via cursor.
Best wishes.
Kamil
P.S. i'm on vacation, so my reply can be late.

>Kamil,
>
>By any chance, do you've SET CURSOR_CLOSE_ON_COMMIT set to ON? You can use sp_dboption system stored procedure to check that.
>
>>Hello All
>>I have two procedures which communicate via a cursor.
>>I did by the book (Help sample), but i get the following error.
>>Server: Msg 16950, Level 16, State 2, Procedure PlaceByDep, Line 8
>>The variable '@PkList' does not currently have a cursor allocated to it.
>>
>>Below are the procedures
>
>>CREATE PROCEDURE PlaceByDep @PK UniqueIdentifier
>>AS
>>Set NoCount ON
>>DECLARE @PkList CURSOR
>>EXEC DeepPk @PK, 'DepPkNodeList', @PkList OUTPUT
>>create table #PkList (PK uniqueidentifier)
>>
>>FETCH NEXT FROM @PkList into @Pk
>>WHILE (@@FETCH_STATUS = 0)
>>BEGIN
>>	Insert Into #PkList (PK) Values (@PK)
>>	FETCH NEXT FROM @PkList into @Pk
>>END
>>CLOSE @PkList
>>DEALLOCATE @PkList
>>select * from #PkList
>>return
>>GO
>>
>>
>>CREATE PROCEDURE [DeepPk] @ParentPK uniqueidentifier
>>	, @NodProc_Na char(64)
>>	, @PkCursor CURSOR VARYING OUTPUT
>>
>>AS
>>create table #PkList (PK uniqueidentifier)
>>Insert into #PkList (Pk) Values (@ParentPK)
>>execute @NodProc_Na @ParentPk
>>
>>Set @PkCursor= Cursor Local Fast_Forward
>>	For Select * from #PkList
>>
>>Open @PkCursor
>>
>>return
>>GO
>
>>
>>
>>Thank you.
>>Kamil
A moment of silence is our cosmic reset button.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform