We want to implement pagination with plain SQL, but can't use a few important keywords because of the legacy database not understanding them. The goal is to get 20 entries instead loading and programmatically paginating 15,000 entries.
They keywords that don't work:
top N
offset N
rownum
limit N
Is there any way to achieve pagination with plain old SQL (no database functions)?
The JDBC bridge to the legacy system is Attunity, below that is an HP NonStop database. We are trying to develop the query in DBVisualizer.
The error message for rownum
is
[Code: 0, SQL State: 42S22] JBC0016E: Remote call failed (return code=-202). JBC0091W: Untranslatable Message: [A033] A column by the name 'rownum' was not found.
Update:
We do have something that looks like numerical primary keys. I am saying it looks like, as we are not sure about the purpose of those numbers. Those numbers do indeed increase like a sequence.
13771
13821
15461
20008
21253
23838
23929
26666