Yes, good point. Already someone can do Infinite loop in stored procedure..
But, i try to minimize to have some special treatment like while loop and 
susspend needed;

And there was a little error in my function it should be:
agg_i=0 if there is an ampty result set.
Agg_i will control the whole execution choices

create aggregate function custom_count_plus_1000 (i integer) returns (o
integer)
as
Begin
   If (agg_i<=1) then  
      Begin
        --init vars and more
        o = 0;
      end;
  -- here body of this function
  -- do whatever you want
  If (agg_i>=1) then  
     o= o + 1;

  if (agg_finished and (agg_i>0)) then
     o = o + 1000;
end

Regards,
Karol Bieniaszewski

Od: Adriano dos Santos Fernandes
Wysłano: piątek, 28 września 2018 21:43
Do: firebird-devel@lists.sourceforge.net
Temat: Re: [Firebird-devel] ODP: User-defined aggregate functions

Karol,

If user code something wrongly or create inifinite loops, wrongly
results he/she will have, no matter how things are defined.

I like your opinion to not limit to only one input parameters. This
limitation seems to not have sense.


Adriano

Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to