Re: [Dev] Cross database pagination

2015-03-23 Thread Vishanth Balasubramaniam
Hi Dulitha, Found this Pagination with ROWNUM example (source [1]), sharing it if you could find it helpful: select * from ( select /*+ FIRST_ROWS(n) */ a.*, ROWNUM rnum from ( your_query_goes_here, with order by ) a where ROWNUM <= :MAX_ROW_TO_FETCH ) where rnum >= :

Re: [Dev] Cross database pagination

2015-03-23 Thread Udara Rathnayake
Hi All, We faced an issue while following the above method. Even if we store the DB specific select query within a configurable file, number of properties and property order may vary from one to another. If we are using prepared statements we need to reflect above differences within our logic. We

Re: [Dev] Cross database pagination

2015-03-03 Thread Udara Rathnayake
Hi All, We had the same discussion yesterday and had a small chat with Prabath too. Since there is no viable solution ATM we decided to store these select statements in a script and pick according to the data-source configuration. Eg:- /dbscripts/social/oracle/, /dbscripts/social/sql/ Since we c

Re: [Dev] Cross database pagination

2015-03-03 Thread Sajith Ariyarathna
IMO, I don't think you can have an universal solution. Paging is not included as a standard feature in SQL specifications (see SQL standardization ). Hence, pagination is an extension for DBMS. So different vendors have implemented it in different m

[Dev] Cross database pagination

2015-03-01 Thread Dulitha Wijewantha
Hi guys, I am working on creating a device listing API that supports pagination. In the SQL world, LIMIT and OFFSET seems to be the standard way of doing pagination in MySQL and PostgreSQL. Below is an example, SELECT Device.id, Device.name FROM Device LIMIT 10 OFFSET 10 But Oracle seems to be u