Subject Re: [firebird-support] Problem using FreeUDFLib
Author Helen Borrie
At 10:46 AM 25/05/2006, you wrote:
>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.
>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.