我安装了 Firebird 4,并且尝试使用 UDR 而不是 UDF。我在这里问这个问题,因为我在任何地方都没有找到 Firebird 论坛和答案。
我的 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
插件/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
}
plugins/udr/udrcpp_example.dll 存在。
我尝试执行这个脚本:
create function sum_args (
n1 integer,
n2 integer,
n3 integer
)
returns integer
external name 'udrcpp_example!sum_args'
engine udr;
我有错误:
入口点无效
你知道我做错了什么吗?
在实现我自己的功能之前,我会尝试让演示正常运行。
我的步骤基于这两个文档: https://firebirdsql.org/file/documentation/html/en/firebirddocs/udr-pascal/udr-pascal.html https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.UDR
我尝试使用演示项目并在 Delphi 中制作 DLL 并像帖子中那样注册。它因同样的错误而失败。这就是为什么我尝试注册演示的一个功能来看看会发生什么。
我似乎在 Delphi 10.4 中使用 FireDac。这个错误就是在Delphi中执行脚本时出现的。如果我使用 isql 连接,我可以注册该函数并稍后使用它。
问题是由于使用FireDac delphi组件造成的。这 !被解释为宏观。
因此,以组件 TFDScript 为例,OFDScript.ScriptOptions.MacroExpand := False 解决了问题