Re: Too many cursors?
Posted in 1997
Nigel Gall wrote: } } Timothy M. Hood wrote: } > } Nigel Gall wrote: } } } } Is it possible to open too many cursors? I have a function that } } declares a normal cursor, opens it, and then fetches the first row. The } } program bombs at the fetch with error number -400: } } } } SQL statement error number -400. } } Fetch attempted on unopen cursor. } } } } the sample code is as follows: } } } } ... } } declare curs cursor for } } <select statement> } } } } open curs } } } } fetch curs into vars.* } } ... } } } } There is no syntax error in the select statement, nor any of the } } statements. Sometimes I get core dumped! } } } } I'm using RDS 6.03.UC1, SE 7.12.UC1 on SCO OpenServer Desktop Rel. 5.0.0 } } on an AST Bravo MS-T P/166 with 16MB RAM and no other programs in } } progress. Any ideas? } } My first thought is that you are doing an update and that you haven't } declared the cursor "WITH HOLD". There is a practical limit to the } number of cursors you can open (system dependant), as each cursor } requires system resources and memory, however, I've never seen anyone } design a program that would need that many open cursors (nor would I } want to!) } } If you aren't updating, can you fill in a little more about the code? } } Tim The code in question is part of a program I purchased from a third-party software house and disclosure of their code segments may be construed as copyright infringement. I have lodged the inquiry with their support department and await their response. If they don't solve this in the next couple of weeks then I shall think about giving more details in this forum. To all who sent/posted suggestions, my sincerest thanks. Best regards, Nigel -- +--------------------------------------------------------------------+ | Name : Edmund Nigel Gall Address: 9A Stanmore Avenue | | Title : Account Executive Port of Spain | | Company : Stratis Caribbean Ltd. Trinidad & Tobago, W.I. | | | | Contact Information: | | Office Personal | | Voice : (809) 623 6530/1 (809) 662 6611 | | Fax : (809) 623 8370 (809) 662 6611 | | Email : ngall@stratis-caribbean.com nigelg@trinidad.net | +----------------- http://www.stratis-caribbean.com -----------------+