Board index » delphi » "Registering" an UDF

"Registering" an UDF

I've compiled an UDF library (rfunc.dll), put it on the lib directory,
restarted the server (just in case).

When I see it on quikview, I see something like this:
    Ordinal        Entry point        Name
    000c            00003160        _fn_month

How should I dfeclare this function in my database?

I'm doing like this:

DECLARE EXTERNAL FUNCTION MONTH

   DATE

   RETURNS INTEGER BY VALUE

  ENTRY_POINT '_fn_month'  MODULE_NAME 'rfunc.dll';

But when I try to call it, I got an error "module name or entry point could
not be found".
The statement I use to test it is this:

select month (cast ("TODAY" as date)) from rdb$database;

What am I doing wrong?

 

Re:"Registering" an UDF


If you're on IB 6 or higher, the UDF needs to go in the UDF directory, not
LIB.

Dan

Quote
"Renato Martins" <ren...@griaule.com.br> wrote in message

news:3c10da7f$1_1@dnews...
Quote
> I've compiled an UDF library (rfunc.dll), put it on the lib directory,
> restarted the server (just in case).

> When I see it on quikview, I see something like this:
>     Ordinal        Entry point        Name
>     000c            00003160        _fn_month

> How should I dfeclare this function in my database?

> I'm doing like this:

> DECLARE EXTERNAL FUNCTION MONTH

>    DATE

>    RETURNS INTEGER BY VALUE

>   ENTRY_POINT '_fn_month'  MODULE_NAME 'rfunc.dll';

> But when I try to call it, I got an error "module name or entry point
could
> not be found".
> The statement I use to test it is this:

> select month (cast ("TODAY" as date)) from rdb$database;

> What am I doing wrong?

Re:"Registering" an UDF


Quote
Renato Martins wrote:

>   ENTRY_POINT '_fn_month'  MODULE_NAME 'rfunc.dll';

        In addition to what Dan wrote, I recommend that you do not include
".dll" in your MODULE_NAME as it makes your DB Windows-specific.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Other Threads