Subject UDF on linux
Author Dalton Calford
I am having a problem with getting a udf to work on a linux box.

Linux version : Ubuntu 9.4 Server edition 64 bit
Firebird version : LI-V2.1.2.18118 Firebird 2.1 64 bit launched via xinetd, classic, installed via install script in /opt/firebird
UDF Library : FreeUDFLibC downloaded from ibphoenix.com, compiled from source

Here is some example DDL for one of the functions

DECLARE EXTERNAL FUNCTION F_DAY_OF_MONTH
Timestamp
RETURNS Integer BY VALUE
ENTRY_POINT 'day_of_month'
MODULE_NAME 'FreeUDFLibC';

The FreeUDFLibC UDF is found in /opt/firebird/UDF

The UDF will register without error, but
select F_DAY_OF_MONTH('02/12/2009') from RDB$DATABASE

Results in

Starting transaction...
Preparing query: select F_DAY_OF_MONTH('02/12/2009') from RDB$DATABASE
Error: *** IBPP::SQLException ***
Context: Statement::Prepare( select F_DAY_OF_MONTH('02/12/2009') from RDB$DATABASE )
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code : 335544343
Engine Message :
invalid request BLR at offset 60
function F_DAY_OF_MONTH is not defined
module name or entrypoint could not be found

Now, the problem also occurs with the UDF libraries that are supplied with firebird.

DECLARE EXTERNAL FUNCTION ascii_char
INTEGER
RETURNS CSTRING(1) FREE_IT
ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf';

Commit;

select ASCII_CHAR(65) from RDB$DATABASE;

Results in

Starting transaction...
Preparing query: select ASCII_CHAR(65) from RDB$DATABASE
Error: *** IBPP::SQLException ***
Context: Statement::Prepare( select ASCII_CHAR(65) from RDB$DATABASE )
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code : 335544343
Engine Message :
invalid request BLR at offset 63
function ASCII_CHAR is not defined
module name or entrypoint could not be found


Now, looking at my firebird.conf file

RootDirectory= /opt/firebird/
UdfAccess = Restrict '/opt/firebird/UDF'

But I have also tried UdfAccess = Full

To no avail.

Does anyone know what I am doing incorrectly?

Best regards

Dalton