I am using Hibernate 2.1 with DB2 for iSeries (AS400).
I have read the other posts in the forum concerning the problems with older versions of AS400 and the ORDER BY clause although I am not sure if the problem has ever been accurately described (and thus a truly good workaround ever suggested).
The problem is that the column name specified in the ORDER BY clause must be the
alias if the column is aliased in the SELECT clause. DB2 actually gives a rather nice error message:
Quote:
The column or expression is in the SELECT list but the result column is renamed using an AS clause. If the AS clause is used to name a column in the result table, the name specified on the AS clause must be the name specified on the ORDER BY clause.
Any suggestions for a workaround? Is there any way I can extend the framework (instead of hacking the source) to resolve this issue.
Thanks.
Hibernate kicks a$$ btw. It is truly a pleasure to work with this software, such a rarity indeed.