Iam getting problems when i use native SQL in DB2.
I have the query as select * from employee
and i have the following code...
Code:
Query qry = session.createSQLQuery(qry);
qry.setFirstResult(1);
qry.setMaxResult(5);
When i execute iam getting an exception.
The query generated by SQL Parser is
Code:
select * from (select rownumber() over() as rownumber, * from employee) as temp_ where ronumber <= 5
which obiviously throws an exception, as we cant select column name, * in sql query (you can see that in the parsed subquery).
Thanks,
Thiru