One "maybe" option, just because there are 1M+ records in the file does not mean you need to read them all. If there is a balance field, or calc that you can do on the 2 fields to "filter out 0 records" then you may be able to create a view with substantially less records, and do your sql with the same selection using the where clause of the same criteria as the view (or read the view). Try this with OPS Nav's performance (or debug) and it will tell you if another view might be better. If every record has a value, the trigger/summary file idea makes the most sense (may be best anyway). regards john John Bussert Swift Technologies, Inc. www.swiftorder.com 847-289-8339 847-289-8939 (fax) email@example.com -----Original Message----- From: firstname.lastname@example.org [mailto:email@example.com] Sent: Monday, January 14, 2002 10:26 AM To: firstname.lastname@example.org Subject: Re: sql help-select sum of 2 fields in flat file I try to use SQL wherever possible, but in this case, it may be very difficult if possible. As I understand it, you're trying to sum fields in a record which are not externally described to allow SQL to identify them. If you ultimately decide to try RPG native file access be sure to check out the BLOCK(*YES) keyword. In some cases it can increase straight reads from a file. Using the Blocking effectively is sometimes what appears to give SQL the advantage. If it were me I'd try it with and without to see if there was any difference. _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l or email: MIDRANGE-Lemail@example.com Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.