|
Huh? Not sure I understand your question. Are you saying that you've called the function multiple times, but the access count for the file only shows one call's worth of I/O? That would make sense since you defined the function as deterministic. The manual states that deterministic "Specifies that the function will always return the same result from successive invocations with identical input arguments." As I understand it, with a deterministic function, OS/400 may cache the prior value and just return it instead of actually calling the function again. This would appear to be what you are seeing. If you're not seeing it, it may be that OS/400 decided not to cache the results. Note that I don't think there's any way to know how long OS/400 keeps this cached value around. I assume it isn't permanent. However, be very careful specifying DETERMINISTIC. I tend to specify deterministic only for functions that don't access files. Such as a date conversion routine. With a function that access a file, it would be too easy for a change to the file not to affect the result of the function when it should have. HTH, Charles Wilt iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: midrange-l-bounces@xxxxxxxxxxxx > [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Bill > Sent: Tuesday, February 15, 2005 12:40 PM > To: Midrange List > Subject: SQL Deterministic UDF and File Read Count > > > I have created an SQL UDF which is specified as > Deterministic. The UDF is > written in RPGLE and accesses a table as part of it's logic. > When I do a > Select statement in SQL and reference the UDF it returns the data as > expected. > > The concern I have is regarding the file access count: it > has the same > number of accesses as there are number of records returned -- > but the input > parameters to the UDF were the same for each UDF access. > > Am I correct that there would be one access to the UDF's table > corresponding to the first "call" and then since each > subsequent call has > the same parameter values it shouldn't access the table > again? This is on > a V5R2 system. > > Bill > > -- > This is the Midrange Systems Technical Discussion > (MIDRANGE-L) mailing list > To post a message email: MIDRANGE-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/midrange-l > or email: MIDRANGE-L-request@xxxxxxxxxxxx > 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.
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.