Search code examples
delphifirebird

Firebird 4 UDR creation Invalid entry point


I installed Firebird 4 and I am trying to use UDR instead of UDF. I ask the question here, because I didn't find Firebird forums and the answers anywhere.

My firebird.conf

ServerMode = Super
DefaultDbCachePages = 20K
FileSystemCacheThreshold = 2M
TempBlockSize = 2M
TempCacheLimit = 1500M
AuthServer = Legacy_Auth, Srp, Win_Sspi
AuthClient = Legacy_Auth, Srp, Win_Sspi
UserManager = Legacy_UserManager, Srp
WireCrypt = Enabled 
RemoteServicePort = 3054
DataTypeCompatibility = 3.0
LockMemSize = 15M
LockHashSlots = 30011
UdfAccess = Restrict UDF
ExternalFileAccess=Full 

plugins/udr_engine.conf

external_engine = UDR {
    plugin_module = UDR_engine
}

plugin_module = UDR_engine {
    filename = $(this)/udr_engine
    plugin_config = UDR_config
}

plugin_config = UDR_config {
    path = $(this)/udr
}

The plugins/udr/udrcpp_example.dll exists.

I try to execute this script:

create function sum_args (
    n1 integer,
    n2 integer,
    n3 integer
)
returns integer
external name 'udrcpp_example!sum_args'
engine udr;

I have the error:

Invalid entry point

Do you have any idea what I am doing wrong?

I try to make the demo works before implementing my own functions.

I based my steps on these 2 documentations : https://firebirdsql.org/file/documentation/html/en/firebirddocs/udr-pascal/udr-pascal.html https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.UDR

I tried to use the demo project and to make a DLL in Delphi and to register like in the post. It failed with the same error. It is why I tried to register a function of the demo to see what happens.

It seems I use FireDac with Delphi 10.4. And it is by executing the script in Delphi that this error comes. If I connect using isql, I am able to register the function and use it later.


Solution

  • The problem was from the use of FireDac delphi components. The ! was interpreted as macro.

    So by example for the component TFDScript, the OFDScript.ScriptOptions.MacroExpand := False solves the problem