Subject Re: [firebird-support] Problem using FreeUDFLib
Author Andrei Luís
Hi Helen, thanks for your time. Answers below:

2006/5/25, Helen Borrie <helebor@...>:
> At 10:46 AM 25/05/2006, you wrote:
> >Hi,
> >
> >I'm using FB 1.5.2 + Win XP Pro + D4 Pro / D2006 Pro
> >
> >I downloaded FreeUDFLib from IBPhoenix, but I'm having problem on
> >trying to use it.
> >
> >I do the following:
> >
> >- Copy FreeUDFLib.dll to %Firebird_Install_Dir%\UDF (there already are
> >fbudf.dll and ib_udf.dll)
> >
> >- Run the following declaration in IBExpert, with a database opened:
> >declare external function f_AgeInMonths
> > date, date
> > returns
> > integer by value
> > entry_point 'AgeInMonths' module_name 'FreeUDFLib';
> >
> >- Commit
> >
> >- And, there is it on UDF List.
> >
> >OK
> >
> >But, when I run this sql in IBExpert I got an error message:
> >
> >select f_ageinmonths(data_aprovado, current_date) from propostas
> >
> >Invalid token.
> >invalid request BLR at offset 60.
> >function F_AGEINMONTHS is not defined.
> >module name or entrypoint could not be found.
> >
> >I tried to declare several udf from FreeUDFLib, and got allways the
> >same erro on using them.
> >
> >For testing, I declared some function from fbudf and ib_udf, and they
> >worked perfect.
> >
> >I already stop/start the server, turn off/on the computer and nothing works.
> >
> >Something I feel strange: FreeUDFLib.dll that is in is
> >dated 08/06/1998, is that correct? I think it is too much old, hu?
> >Besides, I opened the source and build the dll again in Delphi 4 Pro,
> >copy the dll to %Firebird_Install_Dir%\UDF but nothing changes.
> >
> >So, does anybody have a clue what is going on?

> No, it might be a bug in IBExpert causing the problem.
> I have just done exactly the same thing as you did, except that I did
> it using ISQL. It worked perfectly, with no rebooting, restarting or
> anything like that.
> Check your firebird.conf setting for UDFAccess: it should be the default --
> #UdfAccess = Restrict UDF
> For a reality check, do a DROP EXTERNAL FUNCTION, then redeclare it,
> making double-triple-sure that you have not accidentally included the
> ".dll" extension in the MODULE_NAME argument, as it [wrongly] appears
> in the declarations in ext_funcs.sql. As it appears there, it is not
> recognisable syntax for any external function declaration. On
> Windows, the module_name 'FreeUDFLib.dll' would resolve to
> 'FreeUDFLib.dll.dll' which, of course, cannot be found.
> ./heLen

I didn't change firebird.conf, just check to make sure, and it's like
you said: #UdfAccess = Restrict UDF.

I've heard about to declare the functions without the '.dll', and, as
u can see in my first message, I do exactly like I put there, without

I just did it again, now using isql I droped the function, declared
it, try to use it, but got the same error message.

I just did what Ivan Prenosil told: use instclient to generate
gds32.dll, and put it in UDF dir, but, still the same error.

Could u send me FreeUDFLib.dll u have? I don't know if can helps,
but.. Maybe I can copy it to a CD, and leave it resting inside 'The
Firebird book' (in Portuguese) I have. Maybe it works... :-)

So, I don't know what its going on...

By the way, I tested UDF_MonthsBetween from tbUDF.dll, and it works
fine. Do u know if this have the same result of F_AgeInMonths from
FreeUDFLib? What I really need, is to know how months have in a date