Subject Re: [Firebird-Architect] Re: Java Stored Procedures
Author Vlad Horsun
> > > Add to that: a "variant" datatype, so you could do your own
> > > wrapper around "coalesce", for example, would be even more cool.
> >
> > Explain it, please
>
> eg, (totally useless example ;): create a ISNULLTHEN_TRUE function:
>
> create function ISNULLTHEN_TRUE (pin_value VARIANT)
> returns VARIANT
> as begin
> if ((pin_value is null) and (typeof(pin_value) = TYPE_INT))
> then result = 1
> else if ((pin_value is null) and (typeof(pin_value) = TYPE_VARCHAR))
> then result = 'T'
> else result = pin_value;
> end

Passing parameters by descriptor (already available in UDF and only
way in our experimental external engines) can solve this. Only missing
piece is an typeless parameter declaration and probably some internal
engine support (not a big deal, imho)

--
Regards,
Vlad