Can UDF's Add Results From More Than One Record?

By: Borland Staff

Abstract: UDF cannot remember the answer from a previous record

Problem:
How do I get a UDF to add results from more than one record?   I have a function 
that takes the sales for 1 record and adds something to it. I want it to do this for 
every record and give me the total.  I need the UDF to be able to remember the 
previous answer.  Is this possible?

Solution:
Note: The information in this document is relevant to InterBase versions 4.X, and 5.X.


The UDF can not remember the previous answer.  If you are using IB 4.0 (or
4.1 NT)  you can do this, but it will stop working the way you expect on
any superserver version of the database.

If you need to total of some column use an aggregate function like SUM, or
use a stored procedure.

source: listserve





Server Response from: ETNASC04