Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

ZF2 Paginator Does Not Work with DB2 #6165

Closed
kingharrison opened this issue Apr 21, 2014 · 5 comments
Closed

ZF2 Paginator Does Not Work with DB2 #6165

kingharrison opened this issue Apr 21, 2014 · 5 comments
Assignees
Milestone

Comments

@kingharrison
Copy link

ZF2's Paginator does not currently work with DB2 because DB2 does have the Limit or Offset commands. The Paginator would need to have DB2 specific adaptions so that any ZF2 user could use standard commands.

@ralphschindler
Copy link
Member

Can you provide a sample of the ideal paging SQL for DB2?

@kingharrison
Copy link
Author

Here's a sample:
SELECT code, name, address
FROM (
SELECT row_number() OVER ( ORDER BY code ) AS rid, code, name, address
FROM contacts
WHERE name LIKE '%Bob%'
) AS t
WHERE t.rid BETWEEN 20 AND 25
FETCH FIRST 6 ONLY OPTIMIZE FOR 6 ROWS;

The last part,
FETCH FIRST 6 ONLY OPTIMIZE FOR 6 ROWS,
is somewhat optional, for performance.

@ezimuel
Copy link
Contributor

ezimuel commented Jul 17, 2014

@kingharrison I'm working on it, see #6446

@ezimuel ezimuel self-assigned this Jul 17, 2014
@kingharrison
Copy link
Author

@ezimuel Thank you!

@ezimuel ezimuel closed this as completed Aug 4, 2014
@Ocramius Ocramius added this to the 2.3.2 milestone Aug 4, 2014
@kingharrison
Copy link
Author

Woohoo!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants