|
On Tue, Sep 15, 2015 at 9:03 AM, Koester, Michael wrote:
I was intrigued by the idea of GET DIAGNOSTICS, but at least for
my current needs, I too tend to favor opening the process with a
"select count(*) into..."
With that, I can wrap the whole "declare cursor", "open cursor",
"fetch into", and "close cursor" in an "if countOfRows > 0"
structure, thereby not executing unnecessary code when there are no
array rows to be loaded.
While this particular need does not require trimming nanoseconds, I
was just looking for "best practices" ideas that would enhance my
coding, now and future.
Just note that if using a SENSITIVE cursor, the number of rows you
get with the SELECT COUNT may not equal the number of rows fetched.
If you specify an INSENSITIVE cursor, then the count should match
since the system copies the data to temp storage. Unless somebody
adds a row between the SELECT COUNT and the OPEN of the cursor.
The default for cursors is ASENSITIVE, which means you could end up
with either SENSITIVE or INSENSITIVE.
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.