Subject Re: [Firebird-Architect] Re: Java Stored Procedures
Author Martijn Tonies
> > > > 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)

If it's not a big deal to create, go ahead ;-)

I'm asking this - obviously - from a "user" point of view.

You would have to create a way to figure out the actual type of
the parameter in PSQL though.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com