| Author |
ORA 01001 : Invalid Cursor
|
Vinicius Carvalho
Ranch Hand
Joined: Dec 07, 2004
Posts: 61
|
|
Hello there! I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple: SELECT email from USERS; single column, indexed on Oracle 10g. Problem is: 1.98 million results. Well, running this query using a tool like SquirrelSQL (pure java) it does run (ok, I dunno what kind of parameters it use to maybe limit the size of the query return) But truth is, when I run this (I'm using Spring with JDBC here), as soon as I hit: rs.next(); I get this exception. Is there a way to avoid this? I've checked Oracle's docs and it says that it's caused because there's too many opened cursors. I'm stupid on this, but a single connection has more than one cursor? Any ideas on how can I fetch such huge amount of data?
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26168
|
|
Vinicius, Are you closing the connection/statement/resultset when you are done with it? Maybe cursors are open from the previous query? I suggest doing some experimentation to see when you are hitting this problem. You could always do this query in multiple shots (all e-mail beginning with A, B, C, ... to limit results.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
shrikant yaduvanci
Greenhorn
Joined: Jul 23, 2006
Posts: 1
|
|
Originally posted by Vinicius Carvalho: Hello there! I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple: SELECT email from USERS; single column, indexed on Oracle 10g. Problem is: 1.98 million results. Well, running this query using a tool like SquirrelSQL (pure java) it does run (ok, I dunno what kind of parameters it use to maybe limit the size of the query return) But truth is, when I run this (I'm using Spring with JDBC here), as soon as I hit: rs.next(); I get this exception. Is there a way to avoid this? I've checked Oracle's docs and it says that it's caused because there's too many opened cursors. I'm stupid on this, but a single connection has more than one cursor? Any ideas on how can I fetch such huge amount of data?
well first of all increase ur table space. 1 drop table space 2 increase tablespace 3 refer oracle 9i doc
|
srikant
|
 |
Scott Johnson
Ranch Hand
Joined: Aug 24, 2005
Posts: 518
|
|
as soon as I hit: rs.next(); I get this exception.
Sounds like the sql failed to execute and the recordset is not in a valid state. Is there a previous exception thrown that is being supressed? Possibly from the execute? Or is there another exception chained to this one? That exception may give more information as to what caused the problem.
|
 |
 |
|
|
subject: ORA 01001 : Invalid Cursor
|
|
|