Within the same query. The function takes a tuple as its input parameter. It will be used in the where clause. So I think it will be called one time for each read tuple, right? I want to maintain a structure to store the information about the tuples that have been read so far. The output value of this function is computed based on this information and the current input tuple. On 2/15/06, Michael Fuhr <mike@xxxxxxxx> wrote: > On Tue, Feb 14, 2006 at 11:47:49PM +0100, andrew wrote: > > Can I implement a stateful UDF in C? i.e. storing the state of the > > previous run of the function and access them in the succeeding runs. > > Is it supported? How do I implement it? Thanks. > > Do you need to maintain state across sessions or just within a > single session? What are you trying to do? > > -- > Michael Fuhr > -- andrew