Registrating UDR

45 views
Skip to first unread message

Tomasz Dubiel

unread,
Sep 5, 2024, 2:54:43 AM9/5/24
to firebird-support
Hello.
We move from UDFs to UDRs and we have a problem to registrate UDR.
We created dll:

// mydll.c
#include <windows.h>

// Deklaracja funkcji eksportowanej
__declspec(dllexport) int myadd(int *a, int *b)
{
    return *a + *b;
}

then we placed it in ....\Firebird_5_0\plugins\udr\
then we create function in Firebird:

create function myadd (
    a integer,
    b integer
) returns integer
    external name 'mydll!myadd'
    ENGINE UDR;

and when we commit, we get:
Cannot commit transaction:
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
UDR module not loaded.

What did we forget about?
Best regards,
Tomek.

Norbert Saint Georges

unread,
Sep 5, 2024, 3:03:12 AM9/5/24
to firebird...@googlegroups.com
Tomasz Dubiel a écrit :
> Hello.
> We move from UDFs to UDRs and we have a problem to registrate UDR.
> We created dll:
You have an example in c++ in \firebird_5_0\exemples\udr\functions.cpp

--
Norbert Saint Georges
http://tetrasys.fi

Virgo Pärna

unread,
Sep 5, 2024, 3:03:31 AM9/5/24
to firebird...@googlegroups.com
On 05.09.2024 09:54, Tomasz Dubiel wrote:
>
> We move from UDFs to UDRs and we have a problem to registrate UDR.
> We created dll:
>
> /// mydll.c
> #include <windows.h>
>
> // Deklaracja funkcji eksportowanej
> __declspec(dllexport) int myadd(int *a, int *b)
> {
>     return *a + *b;
> }/
>

That does not look like UDR code. It looks like UDF code. Rewrite it as
UDR.

--
Virgo Pärna
Gaiasoft OÜ
vi...@gaiasoft.ee

Tomasz Dubiel

unread,
Sep 5, 2024, 3:12:23 AM9/5/24
to firebird-support
Thanks.
Reply all
Reply to author
Forward
0 new messages