DB2 add ordering when using pagination

Added ordering in DB2 queries using both limit and offset, by extracting the ordering, removing the library/table name and using it in the pagination query.