How to mimic SELECT … LIMIT, OFFSET in OpenEdge SQL? - Forum - OpenEdge General - Progress Community

How to mimic SELECT … LIMIT, OFFSET in OpenEdge SQL?

 Forum

How to mimic SELECT … LIMIT, OFFSET in OpenEdge SQL?

  • The sad part, of course, is that you are unlikely to run into any cement walls ... unless it is on purpose ... but that by doing things differently you could have made something significantly better.

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • Thanks for the vote of confidence! I think? lol

  • I think it is in the nature of programming that a reasonably clever programmer can *eventually* produce code which will do any reasonable task.  Of course, it might have been accomplished 10X faster or run 10X more efficiently or have 10X more productivity or be 10X more suited to on-going evolution of requirements had it been done a different way, but it does work.   It is when you assemble programmers into teams that the likelihood of out and out failure, budget and time overruns, and the like increases.

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • It's not possible in the current OpenEdge 11 and there doesn't seem to be a workaround that can be done from carefully crafted SQL as a general solution (not reliant on queries sorted on PKs, etc.).  There is an enhancement request that has been logged to add a ROWNUM pseudo-column similar to what Oracle has.  That request text verifies that one can only fetch all rows and manually adjust the ResultSet cursor afterwards:

    ... applications must retrieve the whole result set and implement the result set pagination programmatically on the client.  This incurs both programming and performance costs.

    I inquired about the status of the above enhancement request, and was just told that it is not planned for any upcoming release (my emphasis):

    Hi Abe,
    Thank you for your email. This feature is not planned for any upcoming release at this time.
    Regards,
    Rob Holzel

    So if the feature ever does make its way into the OpenEdge SQL engine, it probably won't be for a very long time yet.