Subject Is there a way to create Stored Procedure which uses UDF function from a dll that is not yet physically on the disk?
Author
Hi guys.

I've already posted this question but it has not shown up on the group, so I am sorry if it appears duplicated later.

My case is probably hopeless but I thought I'd ask anyway.

As you know, it is possbile to declare UDF without dll present in the required path. For example:

DECLARE EXTERNAL FUNCTION F_BLOBLOAD
    CSTRING(8191),
    BLOB
    RETURNS PARAMETER 2
    ENTRY_POINT 'blob_load' MODULE_NAME 'FAUfile';

This statement compiles, and everything is ok when I commit transaction even when there is no FAUfile.dll present on the hard drive. This is a good behaviour, it is like a late binding in programming, you got error only if you try to use function which is not in a dll or dll is not present.

However, the same rule does not work when I try to declare stored procedure which is using UDF:

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 ; ^

This statement compiles, but when I try to commit transaction 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

IMHO it is an inconsistent behaviour. Either I should get error when I am commiting declaration of UDF at the first place, or I should not get error when I am creating a SP which is using UDF.

My question is: can I some how commit my stored procedure in case like I've presented? I would like to get the error only when I execute my SP and FAUfile.dll for UDF is not present.

Maybe I could somehow insert manually the SP to the system tables? I know it is unsafe but I really need to be able to create SP under the conditions that dll with udf is not yet present.

Thanks for any advices,

Regards.