Subject RE: [firebird-support] UDF function declaration goofyness
Author Alan McDonald
> This one has me stumped... and it shouldn't. Here is the situation.... I
> simply wanted to use the ABS() funtion from the ib_udf library
> (ib_udf.so, being that it is Loooooonix). I currently DO have a couple
> of other functions successfully declared and used from that library:
>
> DECLARE EXTERNAL FUNCTION STRLEN
> CSTRING (32767)
> RETURNS INTEGER BY VALUE
> ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';
>
> DECLARE EXTERNAL FUNCTION SUBSTR
> CSTRING (80),
> SMALLINT,
> SMALLINT
> RETURNS CSTRING (80) FREE_IT
> ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';
>
> Ok, so I go and get the DDL for ABS() and throw it in there:
>
> DECLARE EXTERNAL FUNCTION abs
> DOUBLE PRECISION
> RETURNS DOUBLE PRECISION BY VALUE
> ENTRY_POINT 'IB_UDF_abs' MODULE_NAME 'ib_udf';
>
> Ok, so now it is defined, so lets try and use it:

I suppose you commited this DDL statement and maybe even disonnected
everyone, reconnected before you got this error?
Alan

>
> Select ABS(-2), ABS(2)
> From RDB$Database
>
> And I get:
>
> Invalid token.invalid request BLR at offset 59.
> function ABS is not defined.
> module name or entrypoint could not be found.
>