Subject RE: [firebird-support] UDF argument mechanisms
Author Dmitry Yemanov
Martijn,

> > > 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';
> >
> > RETURNS PARAMETER <N> was supported for years. BY
> > DESCRIPTOR is supported since FB 1.0.
>
> Is it the same as:
>
> DECLARE EXTERNAL FUNCTION DPOWER
> DOUBLE PRECISION BY DESCRIPTOR,
> DOUBLE PRECISION BY DESCRIPTOR
> RETURNS DOUBLE PRECISION BY DESCRIPTOR
> ENTRY_POINT 'power' MODULE_NAME 'fbudf';
>
> It is, right?

From the SQL point of view - yes. From the UDF writer's one - no ;-)

> > > If input parameters support BY DESCRIPTOR, what other
> > > mechanisms do they support? By Value/Ref, Free It? Etc?
> >
> > Input parameters are passed by reference only. FREE_IT is
> > not applicable to them.
>
> So By Ref is default, and optionally you can do a By Descriptor?

Yes.


Dmitry