×
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.
No referential integrity constraints here. Usually, when I want to check
for records in a secondary file before I allow a delete of, say, a customer
master record, I just used SQL SELECT with COUNT(*) and return that to the
maintenance program.
Works okay, but now I need to check an invoice history table which has about
2,000,000 records, but I only want to check for the last twelve [12] months.
I was wondering if a SELECT into a cursor and then a FETCH FIRST 1 ROWS ONLY
might be faster.
I'm pretty sure the COUNT(*) option has to process all of the records for
the period I pass to it. I figured the SELECT into a cursor did, too, but
don't know for sure.
Thanks.
Jerry C. Adams
IBM i Programmer/Analyst
Try to look unimportant; the enemy may be low on ammo and not want to waste
a bullet on you.
--
A&K Wholesale
Murfreesboro, TN
615-867-5070
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.