How to check if a cursor is already open

How to check if a cursor is already open

Post by Marcel van Velze » Mon, 08 Mar 1999 04:00:00



Hi all,

How can I check if a cursor is already open ? What I want to do is to call
the stored procedure many times and each time just retrieve a certain number
of rows. The tric here is to don't close the cursor. In Oracle you can use
the identifier it <cursorname%ISOPEN>.

Can this also be done in SqlServer 6.5 ?

Hope to hear some info soon,

Marcel van Velzen


 
 
 

How to check if a cursor is already open

Post by Gert Draper » Mon, 08 Mar 1999 04:00:00


I am afraid no such thing exists by my knowledge. Try open cursur and check

-GertD


 
 
 

How to check if a cursor is already open

Post by Tibor Karasz » Tue, 09 Mar 1999 04:00:00


Marcel,

The CURSOR_STATUS() function in 7.0 might do what you want. Don't know about
6.x.

--

MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB
Please do not respond by e-mail unless explicitly asked for.


>Hi all,

>How can I check if a cursor is already open ? What I want to do is to call
>the stored procedure many times and each time just retrieve a certain
number
>of rows. The tric here is to don't close the cursor. In Oracle you can use
>the identifier it <cursorname%ISOPEN>.

>Can this also be done in SqlServer 6.5 ?

>Hope to hear some info soon,

>Marcel van Velzen



 
 
 

1. Check if cursor already exists.

Is there any way to check , whether cusrsor already exists  , before
declaring the cursor(inside stored proc)  .
Because when a procedure fails in the middle, and when it run next time
below message comes.
I'm don't want  to use CURSOR_CLOSE_ON_COMMIT .

Error
-----------
Server: Msg 16915, Level 16, State 1, Procedure sc_CreateTableViewFromTbNo,
Line 31
A cursor with the name 'FieldCursor' already exists.
Server: Msg 16905, Level 16, State 1, Procedure sc_CreateTableViewFromTbNo,
Line 155
The cursor is already open.

Thanks

2. Some Questions

3. how to check if a cursor already exists...

4. database source code needed

5. Checking if database already open

6. FAQ please?

7. Checking if a MDB database is already open

8. group projects in mode ANSI

9. checking if a form is already open

10. Getting "The cursor is already open"-error

11. Checking if a cursor is open

12. Check if a cursor is open??