Sorry, had no time to work on this for the last few days. Well my problem is that I'm more a java developer than a db2 guru. So I programmed the sort function in java but I do not know how to integrate this into DB2.
If I only had to get one resultset and then sort it, I would have done it in my java application. But the problem is that I have to provide paging on the result. So I have to sort at the DB to get the whole set sorted and then cut out my subset for the current page... something like this:
Code:
SELECT n.* FROM
(
SELECT r.*, ROW_NUMBER() OVER() AS rownum
FROM (SELECT * FROM <someTab> ORDER BY <myFunction>) r
) n
WHERE n.rownum < 30 AND n.rownum >= 20
Is that possible to do with Java on DB2?
Many thanks in advance!
mt