SQL, stored procedures, cursors, HELP

Results 1 to 2 of 2

Thread: SQL, stored procedures, cursors, HELP

  1. #1
    Join Date
    Dec 1969

    Default SQL, stored procedures, cursors, HELP

    I have an open cursor in my stored procedure.<BR>If I execute the procedure once it works ok, but if I try to <BR>execute it right after the first time I get an error:<BR>The cursor &#039cursorname&#039 already exists even though I put a<BR>close cursor statement after the cursor&#039s job is done in the sp.<BR>Any suggestions???<BR>Thanks in advance.

  2. #2
    Garth Guest

    Default RE: SQL, stored procedures, cursors, HELP

    Use the DEALLOCATE statement to release the cursor from memory.<BR><BR>On another note, cursors are generally considered evil. They perform procedural operations, but an RDBMS is optimized for set operations. When you perform procedural operations in an environment that is optimized for set operations you are under-utilizing the database technology.<BR><BR>Garth<BR>www.SQLBook.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts