Subject RE: [firebird-support] Re: Writing UDF with Freepascal
Author Svend Meyland Nicolaisen
Now that I reread it I can't see it either. I got fooled by udf compared to
utf.

You get the same error if Firebird can't find the UDF DLL. Where have you
placed the DLL and how is UDF-access configured on your Firebird server.

Which Firebird server version are you using?


/Svend

________________________________

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of kschit
Sent: 2. januar 2008 13:32
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: Writing UDF with Freepascal



--- In firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.com> , Helen Borrie <helebor@...>
wrote:
>
> At 05:46 AM 2/01/2008, you wrote:
> >Hello everybody,
> >
> >I've tried to write with Freepascal a UDF for Firebird.
> >
> >library udf_upper;
> >
> >{$mode DELPHI}{$H+}
> >{$PACKRECORDS C}
> >
> >uses
> > Classes
> > { you can add units after this };
> >
> >
> >function UTF_UPPER(wert : PChar) : PChar; cdecl; export;
> >begin
> > wert1 := String(wert);
> >//Some String operations
> > result := PChar(wert1);
> >end;
> >
> >exports
> > UTF_UPPER name 'UTF_UPPER';
> >
> >begin
> >
> >end.
> >
> >I registered it in Firebird by using:
> >
> >DECLARE EXTERNAL FUNCTION WIDEUPPER
> >CSTRING(32000)
> >RETURNS CSTRING(32000) FREE_IT
> >ENTRY_POINT 'UTF_UPPER' MODULE_NAME 'udf_upper';
> >
> >Everything works ok, but when I try to use the function in a
> >SQL-Statement, it just says:
> >
> >ISC ERROR CODE:335544343
> >
> >ISC ERROR MESSAGE:
> >invalid request BLR at offset 63
> >function WIDEUPPER is not defined
> >module name or entrypoint could not be found
> >
> >I absolutely don't know why...
> >
> >Can somebody please help me?
>
> The UDF exports
> UTF_UPPER name 'UTF_UPPER';
>
> You're declaring
>
> ENTRY_POINT 'UTF_UPPER' MODULE_NAME 'udf_upper';
>
> ./heLen
>
Sorry Helen,

but I just don't get it. What do I have to change. I'm just to stupid.
I would apreciate your answer!

Thank you very much!

Klaus