Subject I can't use a UDF that is already declared in the database
Author Bhavbhuti Nathwani
Hi all

I have just declared a UDF using FlameRobin as follows:
DECLARE EXTERNAL FUNCTION F_BLOBMID
BLOB,
INTEGER,
INTEGER
RETURNS CSTRING(8190) FREE_IT
ENTRY_POINT 'blobmid' MODULE_NAME 'FreeAdhocUDF_borc5_32.dll';


I can see the definition in the tree under Functions and the following
is the FlameRobin properties:
F_BLOBMID
No description [edit]
UDF info

Library name: FreeAdhocUDF_borc5_32.dll
Entry point: blobmid
F_BLOBMID(
blob by blob descriptor,
Integer by reference,
Integer by reference
)
returns:
CSTRING(8190) by reference FREE_IT


Now I try to execute the following SQL statement:
SELECT MCUSTOMSOFFICE.*,
CAST(F_BLOBMID(MADDRESS, 1, 125) AS CHAR(125)) AS CSHORTADDRESS
FROM MCUSTOMSOFFICE MCUSTOMSOFFICE
ORDER BY UPPER(MCUSTOMSOFFICE.CNAME)

I get the following log:
Starting transaction...
Preparing query: SELECT MCUSTOMSOFFICE.*,
CAST(F_BLOBMID(MADDRESS, 1, 125) AS CHAR(125)) AS CSHORTADDRESS
FROM MCUSTOMSOFFICE MCUSTOMSOFFICE
ORDER BY UPPER(MCUSTOMSOFFICE.CNAME)

*** IBPP::SQLException ***
Context: Statement::Prepare( SELECT MCUSTOMSOFFICE.*,
CAST(F_BLOBMID(MADDRESS, 1, 125) AS CHAR(125)) AS CSHORTADDRESS
FROM MCUSTOMSOFFICE MCUSTOMSOFFICE
ORDER BY UPPER(MCUSTOMSOFFICE.CNAME)
)
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

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


Execute time: 00:00:00.


Please advise on what I have done wrong here.

Thanks and regards.
Bhavbhuti