Subject RE: [firebird-support] Re: Writing UDF with Freepascal
Author Svend Meyland Nicolaisen
Well I don't have any experience with neither OpenSuse nor Free Pascal but:

*) Have you checked the UdfAccess setting in firebird.conf?
*) What is the filename of the library that Free Pascal generates?
udf_upper.so?
*) Can you get any of the UDF's in for example fbudf to work?

/Svend

________________________________

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



I'm using Firebird 2.0.3 in an OpenSuse 10.3 environment. I use
Freepascal 0.9.24 and placed the file in /opt/firebird/UDF

Klaus

--- In firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.com> , "Svend Meyland Nicolaisen"
<news@...> wrote:
>
> 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%40yahoogroups.com>
> [mailto:firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.com> ] On Behalf Of kschit
> Sent: 2. januar 2008 13:32
> To: firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.com>
> Subject: [firebird-support] Re: Writing UDF with Freepascal
>
>
>
> --- In firebird-support@yahoogroups.com
<mailto:firebird-support%40yahoogroups.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
>