• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ORA 01001 : Invalid Cursor

 
Vinicius Carvalho
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34656
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shrikant yaduvanci
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic