(self, statement, limit, offset)
return statement
specific method to handle Oracle's insane pagination
specific method to handle Oracle's insane pagination
specific method to handle Oracle s insane pagination
def handle_pagination(self, statement, limit, offset):
        '''specific method to handle Oracle's insane pagination'''

        if limit == None:
            return statement

        # handle crazy logic to convert offset to start/end.  Note that
        # offset starts at 1 in oracle
        start = offset + 1
        end = start + limit - 1


        if offset == 0:
            page = "rownum between %s and %s" % (start, end)
            statement = "SELECT * FROM (%s) WHERE %s" % (statement, page)
        else:
            page = "spt_rownum between %s and %s" % (start, end)
            statement = "SELECT * FROM ( SELECT spt.*, rownum as spt_rownum FROM (%s ) spt ) WHERE %s" % (statement, page)

        return statement
def handle_pagination ( self , statement , limit , offset ) : if limit == None : return statement # handle crazy logic to convert offset to start/end.  Note that # offset starts at 1 in oracle start = offset + 1 end = start + limit - 1 if offset == 0 : page = "rownum between %s and %s" % ( start , end ) statement = "SELECT * FROM (%s) WHERE %s" % ( statement , page ) else : page = "spt_rownum between %s and %s" % ( start , end ) statement = "SELECT * FROM ( SELECT spt.*, rownum as spt_rownum FROM (%s ) spt ) WHERE %s" % ( statement , page ) return statement