Subject Re: [firebird-support] Problem with UDF
Author Helen Borrie
At 02:11 PM 27/09/2007, you wrote:
>I'm written a UDF for stripping leading 0's from strings and added it
>to the database on my main server and the local copy on my computer.
>On my computer I can use it in queries without a problem but when I
>try using it on the server I get:
>
>Invalid token.
>Invalid request BLR at offset 70.
>Function STRIPZERO is not defined.
>Module name or entrypoint could not be found.
>
>I've disconnected/reconnected and restarted the server but it made no
>difference.
>
>The UDF is declared as:
>
>DECLARE EXTERNAL FUNCTION STRIPZERO
> CSTRING(256) CHARACTER SET WIN1252
>RETURNS CSTRING(256) CHARACTER SET WIN1252 FREE_IT
>ENTRY_POINT 'StripLeadingZero' MODULE_NAME 'Project1';
>
>I'm running 2.01.12855 under XP SP2 on both computers. firebird.conf
>on both is identical.
>
>Does anyone know what's going wrong?

What it says - it can't find the module or, if it's finding the
module, it can't find the entrypoint for the function. The
declaration looks OK, so use isql SHOW FUNCTIONS to confirm that the
declaration is committed. It's possibly just a case of not having
all the ducks lined up, viz.

1. On Windows, the module's file name must be 'Project1.dll'
2. In Firebird.conf, the parameter of interest is UDFAccess. The
default for this is Restrict UDF, meaning that the engine will look
for modules only in $firebirddir\UDF. If you placed the DLL
somewhere else, you will need to uncomment the default, add a
semicolon to UDF (which is a relative path) and then append the full
path to where your DLL is.
3. Any changes you make in firebird.conf will take effect only after
the server has been stopped and restarted. Shutting down the
database is not enough.

./heLen