File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 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: 9327

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: 31551

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