This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Current Row Index for Bulk Updates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Current Row Index for Bulk Updates" Watch "Current Row Index for Bulk Updates" New topic

Current Row Index for Bulk Updates

Ankit Garg

Joined: Aug 03, 2008
Posts: 9374

Hello, I'm not sure whether this was the correct forum for this question or ORM forum so I posted it here. I have a table with this structure

join date

Now I want to run a bulk update command to set the rank based on the points and join date. So I want to run a query like this

Now what I don't know is how to represent this |row index| in the query. Is there any solution in JPQL?? Or is there any native query for this. I'm using MySQL 5.0.

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32305

It's the ORM forum. I'll move it.

[OCA 8 book] [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
I agree. Here's the link:
subject: Current Row Index for Bulk Updates
It's not a secret anymore!