Working on: Fedora Core2, Sun jdk 1.5, Tomcat 5.5.7, Hibernate 2.1.6, AS/400-DB2 Take a look at the following two Queries: #Hibernate generated query with Session.createQuery on SYS_CAT table: select * from ( select rownumber() over() as row_, syscat0_.SYS_CAT_ID as SYS_CAT_ID from SYS_CAT syscat0_ ) as temp_ where row_ <= 10
#The problem with this is AS/400-DB2 has a function called rrn(table_name) to fetch the row number, so when I replaced "rownumber() over()" with "rrn()", it worked without any problems which is given below: select * from ( select rrn(syscat0_) as row_, syscat0_.SYS_CAT_ID as SYS_CAT_ID from SYS_CAT syscat0_ ) as temp_ where row_<=10 Does this mean that I will not be able to use Criteria Queries with Hibernate and wiill have to fall back on jdbc api to be able to retrieve desired number of rows of records at a time? If anybody has experiece with this sort of stuffs, please let me know! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]