This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes order by with updatable SCROLL_SENSITIVE gives problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "order by with updatable SCROLL_SENSITIVE gives problem" Watch "order by with updatable SCROLL_SENSITIVE gives problem" New topic
Author

order by with updatable SCROLL_SENSITIVE gives problem

Vikram Kamate
Greenhorn

Joined: Sep 28, 2002
Posts: 16
Hi all,
I am opening a updatable and scrollable resultset on Oracle table. My sql query is simple I am quring single table but I have order by cluase in my query. Query excuted successfuly.
but next() method on resultset gives problem for 10 iteration. then I changed statement.setFetchSize(20) now its giving for problem on 20th if I remove order by it works fine. but I want ordered records.
some buddy suggested.
SELECT AGENT_CLIENT_ID, LAST_CYCLE_DATE
from (select AGENT_CLIENT_ID, LAST_CYCLE_DATE from commission_detail order by AGENT_CLIENT_ID)
but then update dosent work.
please help me.
thankx in advance
Vikram
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
What problem do you get? Does it fail silently or do you get an exception -- and if you get an exception, can you post stack trace, SQL error code and SQL state?
- Peter
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

I'm pretty sure you can't update using a join or correlated subquery. This means that it would not be possible to create an updateable resultset using a query that contains one.
Jamie
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: order by with updatable SCROLL_SENSITIVE gives problem