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