× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Using SQL the right way was (Re: Reading the next record in SQL: is there a secret when using OFFSET?)
  • From: "Dsternb" <dieter.bender@xxxxxxxxxxxx>
  • Date: Fri, 6 Oct 2023 22:07:02 +0200
  • List-archive: <https://archive.midrange.com/midrange-l/>
  • List-post: <mailto:midrange-l@lists.midrange.com>
  • List-subscribe: <https://lists.midrange.com/mailman/listinfo/midrange-l>, <mailto:midrange-l-request@lists.midrange.com?subject=subscribe>
  • List-unsubscribe: <https://lists.midrange.com/mailman/options/midrange-l>, <mailto:midrange-l-request@lists.midrange.com?subject=unsubscribe>
  • Ui-outboundreport: notjunk:1;M01:P0:fWkaswFMo5Q=;4kTVlzROmdkAjsxsRcL2vbwmcVz pX2P8TaX3CCSHKhybAZqZhXE0e4s3SUXkFqqWJ9LgnO2RVbsq2BDx7WALnarVxM0EwCyBdGfB B7NWnGrBL5BsyzUghbJpQPzWcXRmIf1NTnl4arK+HMdRCEARSW76J6LtRurcvkBbHnaEN1uJg dzUkz8Ok15lfxsxeQLTkMTA0JqLxYS4AK0DKYmWHXFUQG4Sg8zQcwqxuc07NOLnv0Bsj8scxo AYEmY4jcUDzg2OvZ1Z0e8iUdDltKwztAs19Ag+7Mp8AwIyoFNFgDn7HRfQ7Cw36zaFxLna7hd 1sOVDG3Jseg0On2ICf8MsFjN2WPusf/X/N1dL37LJiICycN21DkG3XqgiU2pQAXIyNHea1gwT aTKGbNf6UL+8epKRkbx3w0CkGf+FePK3f7za2juIlfEHM1ucns6PcDu8W+OTFu9LnuAL7uXVL juuaNohjFcFJkjyWNgIIg/rouAOdJzbPBgHOCj7qBexVNjfQYCVwvlYlT1lesFNlBoMMt9DXe enAggpIt6dpQ5iz8AnlNfiNxOrFk0MML7CCUFn7qJyP/kIbPxqjM2t4UNOaVwhhtTqDy0xNsI pUOpUZo24zwnKFZnh6fIzeeXhHs+5lnqk4DaVhD9IcvDDG18cf1QiK6R2DZ8xmXwJp49F7BC9 nGM6qnV3OI67K4K7mIjNOxkj4mc75Jh7nnsvFvKIFyMcdp18033GLHtkmx/l1x88ttuA6whsX h1mSDGv72jaigU/VgUu5zHnUi6ND0MSBUP8dqyFL7BnIEabYFaHfS0izC6+TeRa4+Qrfp4IC8 zJhSNSMbOejOUhsi5hgzdQhLwEdLE8eb3t+uKTg0zLc5fd2H1lZahnp3F2VFM04gvZ3KB2yq9 Q/Y7L33c+D+qyyQ==

<Charles>
You can't just replace RLA with SQL.

Sure your users may be used to a POSITION TO and being able to roll
backward. But that isn't the way to use SQL.
</Charles>

Positioning and scrolling forth and back could be done with SQL too!

You would simply need two cursors. One is limited down to the position and the other up from the position. For a one field key very simple:
- cursor_up: select * from someView where some_key >= possition order by some_key
- cursor_down: select * from someView where some_key < position order by some key desc
For a compound key see my earlier post. Another solution would be to put the keys together in the select statement to one compound (concat or something like this). If you wanna make heavy use of this, put this logic in a data access SRVPGM and call the position, getNext, getPrevies,... procedures from your subfile programms. These DAO SRVPGMs would look very similar to your programms of your business logic.

And best of it, you would get all additional funtionality of the power of SQL on top!!!

D*B



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.