Added support for paging based sql query