Subject Re: [IB-Architect] Re: UDF's
Author Ann W. Harrison
At 09:25 AM 4/3/2001 +0000, Ian A. Newby wrote:

>... certain generic udf's could be written
>and shipped as part of the core interbase/Firebird engine.

Now that there's a general consensus on a couple of dozen common
functions, the reasonable solution is to build them into the engine,
just as UPPER is built in. There's a minor bit of design required
to deal with addressing significant numbers of functions in BLR -
requires a two level structure or something like that to avoid
over burdening the byte codes.

>Correctly written udf's could also I belive get around the lack of
>support for certain interbase/firebird features in the stored
>procedure/ trigger language and dynamic SQL, namely BLOB access,
>string manipulation, array support? etc.

UDFs are not a panacea - even good ones. They take a single set
of inputs and return a single value, so they're not a replacement
for stored procedures or aggregate expressions.


> > The existing mechanism can pass internal descriptors (which have
> > all the crud you want), but it isn't particularly documented.
> > Read to code and write a HOWTO.
>
>Any pointers as to where in the code I should look? Does this also
>cover pre-allocation of return parameters?

The descriptor is defined in dsc.h - the mechanism in defined
in fun.e. Both in JRD. Both C.

>(I am useless at C so don't look at me to do it if you want it to work!)

Sigh. Somebody's going to have to build an example. Looks
to me as if the code is all there - though the internationalization
calls, which use the same mechanism, don't implement it. Somehow
I doubt that they care.


Regards,

Ann
www.ibphoenix.com
We have answers.