|
Hi Daniel
My +1 is an agreement with your statement about thinking about sets. In
COMMON's basic SQL bootcamp, I was given the opportunity to speak about
SELECT statements - and in that presentation, set theory was a vitally
important part of what I said. As you say here, replacing
record-level-access with several FETCH's will usually have poor
performance. In its simplest form, using a JOIN of header and detail
tables is a basic first step.
At any rate, I believe we might be agreeing "violently" - does that
translate well auf Deutsch? I hope so!
Regards
Vern
On 8/21/2024 12:12 AM, Daniel Gross wrote:
rpg400-l@xxxxxxxxxxxxxxxxxx>:Am 20.08.2024 um 22:32 schrieb VERNON HAMBERG Owner via RPG400-L <
wrote:Thanks Vernon.
+1 on working with data sets!
On Tue, 20 Aug, 2024 at 10:17 AM, Daniel Gross <daniel@xxxxxxxx>
and how the a linked together - maybe you can join the data to another
To utilize the full power of SQL you should think about "data sets"
table - so that you don't have thousands of open/close operations or
select-into statements.
What I mean with that comment is, that to fully utilize SQL inapplication programming, you have to let go of the "good old RPG chain or
setll/reade" logic.
start with SQL - and I try to implement all data access in 1 SQL statement.
When designing a new or redesigning an existing application, I always
datasets, and so on - and even adding "level checks" using ROW_NUMBER
That means, joining all additional data, using UNION to append different
OVER(PARTITION BY ...) to always know where in my dataset I am. Only after
that, I might implement a SQL cursor loop in RPG.
don't just replace RPG with SQL statements - replace the whole logic.
So my recommendation for embedded SQL to other programmers is always -
- but you can simply copy them into iACS and run them to understand what
The funny thing is - those SQL statements might look hard to understand
they are doing. You can't do that with SETLL/READE.
--
Kind regards,
Daniel
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
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.