Subject Re: [firebird-support] UDF argument mechanisms
Author Martijn Tonies
Hi Dmitry,

> > I must say I've failed to follow the existing UDF argument
> > mechanisms...
> >
> > From what I understood, Firebird 1 supports the "By Descriptor" output
> > argument mechanism. But does it also support this:
>
> FB 1.0 supports BY DESCRIPTOR for input arguments.

Ah, good - than I had a failure here :)

> > 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?

> > Or is this Fb 1.5?
>
> Nothing was changed in FB 1.5.

Good.

> > 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?


With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird & MS SQL Server.
Upscene Productions
http://www.upscene.com