Страница 1 из 1

Нужна помощь с подключением UDF

Добавлено: 03 апр 2006, 12:27
mad
Сама функция из статей на Ibase.ru.
Подключаю к Firebird 1.5.2. Использую Delphi 2006

function AddA(var iSmall: SmallInt; var iLong: Integer): Integer; cdecl; export;
begin
Result := iSmall + iLong;
end;

Dll называется udftest.dll

В sqlmanagere for Interbase/Firebird

DECLARE EXTERNAL FUNCTION ADD_test_func
SMALLINT,
INTEGER
RETURNS INTEGER BY VALUE
ENTRY_POINT 'AddA' MODULE_NAME 'udftest';


Делай запрос.

select AddA(csh_sale,5) from cash;

И получаю ответ...

An error was found in the application program input parameters for the SQL statement.Dynamic SQL Error.
SQL error code = -804.
Function unknown.
ADDA.

Почему....

Добавлено: 03 апр 2006, 12:51
kdv
потому

select ADD_test_func(csh_sale,5) from cash;

Добавлено: 03 апр 2006, 12:55
mad
Invalid token.
Invalid request BLR at offset 60.
Function ADD_test_func is not defined.
Module name or entrypoint could not be found.

Добавлено: 03 апр 2006, 12:57
kdv
dll куда положил? вызывает ли она другие dll? если да, то видны ли эти dll в path? В общем, FAQ...

Добавлено: 03 апр 2006, 20:51
mad
Лежит в "C:\Program Files\Firebird\Firebird_1_5\UDF\"
Другие библиотеки не запускает..

Добавлено: 03 апр 2006, 21:25
kdv
посмотри конфигурацию udf в firebird.conf

если все ОК, но udf не работает, запускай filemon (sysinternals.com), и мониторь fbserver.exe.
сотри в filemon все, сделай коннект, подготовся выполнить запрос. включи лог filemon, выполни запрос. смотри, куда чего и где ищется.