Re: Too many cursors?
Posted in 1997
Taken from the Informix guide to SQL: reference "the sum of the number of open cursors and the number of prepared statements that you can have at one time in one process cannot be larger than 256" ...at least fro v4.1/5 tools/engines :-) HTH, Marco ____________________________________________________________________________ rem radioterapia, which I immeritately manage, seldom agrees with what I say marco greco (Catania, Italy) Work: marcog@ctonline.it rem radioterapia 39 95 447828 fax 446558 (was mar.greco@agora.stm.it) Achea 39 95 503117 --- On Wed, 05 Feb 1997 19:14:23 GMT Nils Myklebust <Nils.Myklebust@idg.no> wrote: }I have hit the limit in one special database maintenance program once. }That is now rewritten to use stored procedures instead. }I don't know exactly what the limit was, but would guess at over 50 }cursors. } }timhood@sisna.com ("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 }: } }Nils.Myklebust@idg.no }NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway }My opinions are those of my company }The Informix FAQ is at http://www.iiug.org } -----------------End of Original Message-----------------