Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure Declare Select

Status
Not open for further replies.

trenttc

Technical User
Joined
Feb 25, 2002
Messages
68
Location
US
Why is it that when I specify 2 column names in the select stmt (vs select 1 column name or select *), I get "Cursor not open" ? I only want to FETCH 2 of many columns.
DECLARE cursorP CURSOR FOR
SELECT code,desc FROM products
 
Because CURSORS must be opened before use them and also closed and released:
Code:
DECLARE cursorP
        CURSOR FOR
SELECT code,desc FROM products

[COLOR=red][b]
OPEN cursorP
[/b][/color red]
FETCH ....



[COLOR=red][b]
CLOSE cursorP
DEALLOCATE cursorP
[/b][/color red]

Can you post what you want to do/. Maybe there is a way to do it w/o cursor. Cursors are performance killers.


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
It was a syntax error" he said sheepishly.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top