0

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
michaelbahr
  • 4,837
  • 2
  • 39
  • 75

1 Answers1

-1

The syntax for limit in Attunity SQL is LIMIT TO X ROWS. That syntax will limit the number of rows to that you set X to.