|
Am 20.08.2024 um 22:32 schrieb VERNON HAMBERG Owner via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>:Thanks Vernon.
+1 on working with data sets!
What I mean with that comment is, that to fully utilize SQL in application programming, you have to let go of the "good old RPG chain or setll/reade" logic.On Tue, 20 Aug, 2024 at 10:17 AM, Daniel Gross <daniel@xxxxxxxx> wrote:
To utilize the full power of SQL you should think about "data sets" and how the a linked together - maybe you can join the data to another table - so that you don't have thousands of open/close operations or select-into statements.
When designing a new or redesigning an existing application, I always start with SQL - and I try to implement all data access in 1 SQL statement.
That means, joining all additional data, using UNION to append different datasets, and so on - and even adding "level checks" using ROW_NUMBER OVER(PARTITION BY ...) to always know where in my dataset I am. Only after that, I might implement a SQL cursor loop in RPG.
So my recommendation for embedded SQL to other programmers is always - don't just replace RPG with SQL statements - replace the whole logic.
The funny thing is - those SQL statements might look hard to understand - but you can simply copy them into iACS and run them to understand what they are doing. You can't do that with SETLL/READE.
Kind regards,
Daniel
As an Amazon Associate we earn from qualifying purchases.
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.