Subject Re: [firebird-support] Re: fbudf dpower declaration pb
Author Helen Borrie
At 07:21 AM 23/09/2003 +0000, you wrote:
>--- In firebird-support@yahoogroups.com, A6-CMO Philippe Makowski
><makowski@a...> wrote:
> > I have a problem with this udf
> > I declare :
> > DECLARE EXTERNAL FUNCTION DPOWER
> > DOUBLE PRECISION, DOUBLE PRECISION
> > RETURNS DOUBLE PRECISION BY DESCRIPTOR
> > ENTRY_POINT 'power' MODULE_NAME 'fbudf';
> >
>I found !
>the right syntaxe is :
>DECLARE EXTERNAL FUNCTION DPOWER
> DOUBLE PRECISION BY DESCRIPTOR,
> DOUBLE PRECISION BY DESCRIPTOR,
> DOUBLE PRECISION BY DESCRIPTOR
> RETURNS PARAMETER 3
> ENTRY_POINT 'power' MODULE_NAME 'fbudf';
>
>
>but I don't understand why.

Because the arguments are being passed *both ways* (input + return) by
descriptor (not by value, not by reference...)

The safest thing with UDFs is not to guess the declaration, but to use the
supplied SQL file. The authors generally know what they are doing. :-)

heLen