|
The copy books contain common code used in more than 50 places. It's notI'll second the opinion that "source code re-use" is neither a best
confusing when you're consistent and I'm very consistent! If I have to
change the core components of the SQL, I'd like to do it once, in one
place. WRT "confusing"--absolutely not! I'm merely following best
practices by reusing code (it just happens to be source, not object).
Every time you reference an externally-defined file or execute a CALL,
you're reusing code. The fact the reuse is by the compiler is irrelevant.
But nested INCLUDES wouldn't be something I'd try--that could make the code
harder to navigate. EXEC IMMEDIATE isn't an option because I'm running
multiple queries for every transaction.
The original logic used an SQL stored procedure. But the nature of this
extremely complex pricing application caused that SP to be called millions
(as counted by performance tools) of times a day. A major increase in the
number of records in the database caused performance to tank so I swapped
out the SQL SP for a service program SP. That helped a bit but I still had
a problem so I tested a WHERE EXISTS clause in an attempt to push as much
of the selection load as possible into the database engine. While the
performance in that approach was substantially better, I wondered if I
could improve a bit more.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.