Subject | Re: [firebird-support] I can't use a UDF that is already declared in the database |
---|---|
Author | Helen Borrie |
Post date | 2008-10-09T11:40:48Z |
At 20:33 9/10/2008, you wrote:
#UdfAccess = Restrict UDF
and locate your dll in the UDF directory beneath the Firebird rootdir.
(You'll need to drop and redeclare the UDF), with commits after each):
DECLARE EXTERNAL FUNCTION F_BLOBMID
BLOB,
INTEGER,
INTEGER
RETURNS CSTRING(8190) FREE_IT
ENTRY_POINT 'blobmid' MODULE_NAME 'FreeAdhocUDF_borc5_32';
./heLen
>Hi allTake out ".dll" unless your UDFAccess setting in firebird.conf is FULL (not recommended, as this makes your database platform-dependent). Leave the default setting in firebird.conf as
>
>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.
#UdfAccess = Restrict UDF
and locate your dll in the UDF directory beneath the Firebird rootdir.
(You'll need to drop and redeclare the UDF), with commits after each):
DECLARE EXTERNAL FUNCTION F_BLOBMID
BLOB,
INTEGER,
INTEGER
RETURNS CSTRING(8190) FREE_IT
ENTRY_POINT 'blobmid' MODULE_NAME 'FreeAdhocUDF_borc5_32';
./heLen