Subject Re: Moving UDF from 1.5 to 2.0 problems
Author unclejung
Krzysztof,

Have you verified that MyUdf.dll (or whatever its real name is) is in
the UDF directory of you Firebird 2.0 installation? If it's not, copy
it to that location and restart Firebird.

You can test the UDF using a this sql statement:

select DATEASNUMTEXT20(cast 'now' as timestamp) from rdb$database

Ignore my ignorance for a second...what does DATEASNUMTEXT20 returns?
Would a simple timestamp to string cast does the job?


- Jung

--- In firebird-support@yahoogroups.com, Krzysztof Koz³owski
<kozlorf@...> wrote:
>
> Hi,
>
> I'm using the Firebird DB in my project, and started moving everything
> from 1.5 to 2.0, and found a problem. Everything worked fine under
> 1.5. However, now when I run the project, I get the following
> exception (I use the same DB file which I used under 1.5):
>
> "invalid request BLR at offset 48
> function DATEASNUMTEXT20 is not defined
> module name or entrypoint could not be found"
>
> DATEASNUMTEXT20 is an UDF function.
>
> I have tried to build up the DB from scratch using an existing script,
> which worked under 1.5. In the header it contains the declaration:
>
> DECLARE EXTERNAL FUNCTION DATEASNUMTEXT20
> TIMESTAMP
> RETURNS CSTRING(64) FREE_IT
> ENTRY_POINT 'DateAsNumText20' MODULE_NAME 'MyUDF';
>
> and it runs through it with no errors. However it gives me the same
> error in the middle of the script:
>
>
/*******************************************************************************
> The next statement causes the following error:
>
> Invalid token.
> invalid request BLR at offset 52.
> function DATEASNUMTEXT20 is not defined.
> module name or entrypoint could not be found.
>
*******************************************************************************/
> CREATE TRIGGER CLIENT_ACTIVE_BI FOR CLIENT_ACTIVE
> ACTIVE BEFORE INSERT POSITION 0
> AS
> BEGIN
> IF (NEW.ID IS NULL) THEN
> NEW.ID = GEN_ID(GEN_CLIENT_ACTIVE_ID,1);
> NEW.MARKER = dateasnumtext20(NEW.msgtime)||nowasnumtext20();
> END
> ;
>
> What can be the problem here?
>
> Regards,
>
> Krzysztof
>