Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Unanswered: Invalid Cursor State

    Hi,

    I have a stored procedure that calls 2 other stored procedures and combines the results into a temporary table. The results of the temporary table is then returned from the stored procedure.

    When I execute the stored procedure in Query Analyzer, I get the exact data I want in the correct format - no errors.

    When I execute that stored procedure in Omnivex SQL Link 3, I get an "Invalid Cursor State" error.

    I did some digging on that error, and found that it could be related to print statements within the stored procedures. I removed all print statements from all 3 stored procedures and the error is still occuring.

    Any suggestions?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I suggest you post the code for the stored procedure and somebody will help you rewrite it without using a cursor. 99 times out of 100 they aren't necessary and only impede performance.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Dude...I don't believe they are using a Cursor in the code...

    What is Omnivex SQL Link 3 anyway?

    EDIT: AHA

    http://www.omnivex.com/index.asp

    Is there code on the SQL Link side? Or does it act like ODBC....my Guess it's middleware and that's where you're problem resdies
    Last edited by Brett Kaiser; 02-25-05 at 10:36.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Good point.

    I wonder if the stored proc might be returning spurious information before the final recordset. Maybe a simple SET NOCOUNT ON would solve the problem.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Feb 2005
    Posts
    4

    Smile

    That is brilliant! The SET NOCOUNT ON/OFF did the trick! Thank you so much!!!!

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    "An expert is a person who has made all possible mistakes in a very narrow field." - Niels Bohr
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.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
  •