Subject | Is there a way to create Stored Procedure which uses UDF when there is no DLL with implementation? |
---|---|
Author | |
Post date | 2014-01-15T19:07:54Z |
Hello,
take a look at this example UDF declaration:
DECLARE EXTERNAL FUNCTION F_BLOBLOAD
CSTRING(8191),
BLOB
RETURNS PARAMETER 2
ENTRY_POINT 'blob_load' MODULE_NAME 'FAUfile';
I can compile and save this function even when there is NO FAUfile.dll physically on the disk. I will get error only when I try to use this function, and that is fine.
Now, take a look at this code:
SET TERM ^ ;
CREATE PROCEDURE TEST (BINARY_VALUE BLOB SUB_TYPE 0)
AS
BEGIN
SELECT
F_BLOBLOAD('c:\blabla')
FROM
RDB$DATABASE
INTO
:BINARY_VALUE;
END^
SET TERM ; ^
My stored procedure is using the UDF function. I can compile this SP without an error, but I can not save it to database. I am getting error:
Engine Code : 335544343
Engine Message :
invalid request BLR at offset 50
function F_BLOBLOAD is not defined
module name or entrypoint could not be found
My question is, can I somehow store this SP in the database even if there is no DLL present at the time of saving SP? Can I somehow cheat the FB to think that the DLL is present, really any solution would be fine for me...
I find current behaviour inconsistent, either Firebird should prevent me from creating UDF when there is no dll present or it should allow me to create SP which is using UDF.
Thanks for any advices, I really need to be able to create SP with UDF in conditions where there is not yet dll created for that UDF.
take a look at this example UDF declaration:
DECLARE EXTERNAL FUNCTION F_BLOBLOAD
CSTRING(8191),
BLOB
RETURNS PARAMETER 2
ENTRY_POINT 'blob_load' MODULE_NAME 'FAUfile';
I can compile and save this function even when there is NO FAUfile.dll physically on the disk. I will get error only when I try to use this function, and that is fine.
Now, take a look at this code:
SET TERM ^ ;
CREATE PROCEDURE TEST (BINARY_VALUE BLOB SUB_TYPE 0)
AS
BEGIN
SELECT
F_BLOBLOAD('c:\blabla')
FROM
RDB$DATABASE
INTO
:BINARY_VALUE;
END^
SET TERM ; ^
My stored procedure is using the UDF function. I can compile this SP without an error, but I can not save it to database. I am getting error:
Engine Code : 335544343
Engine Message :
invalid request BLR at offset 50
function F_BLOBLOAD is not defined
module name or entrypoint could not be found
My question is, can I somehow store this SP in the database even if there is no DLL present at the time of saving SP? Can I somehow cheat the FB to think that the DLL is present, really any solution would be fine for me...
I find current behaviour inconsistent, either Firebird should prevent me from creating UDF when there is no dll present or it should allow me to create SP which is using UDF.
Thanks for any advices, I really need to be able to create SP with UDF in conditions where there is not yet dll created for that UDF.