Subject Re: [firebird-support] Problem with FreeAdhocUDF
Author Richard Wesley
On May 3, 2007, at 05:15, Guido Klapperich wrote:

> W2K (Server) Thu May 03 14:09:13 2007
> The user defined function: F_INCDATE
> referencing entrypoint: incdate
> in module: FreeAdhocUDF
> caused the fatal exception: Access violation.
> The code attempted to access a virtual
> address without privilege to do so.
> This exception will cause the Firebird server
> to terminate abnormally.
>
> I use Firebird 2.0.1. Any hints for me, what can cause the problem?

Did you reload the API descriptions?

FreeAdHocUDF changed some API definitions to support the new NULL
passing conventions in FB2. If you don't reload them, you may get
things like this. I should warn you that the convenient scripts
provided do not all work correctly and I found it expedient to just
toss all UDF references for FreeAdhocUDF and reload them:

void
FirebirdProtocol::UnlinkUDFFile(

DBTransactionPtr tr,
LPCTSTR udfFilename )
{
CString cmd;
cmd.Format( _T("DELETE FROM RDB$FUNCTION_ARGUMENTS\n")
_T(" WHERE RDB$FUNCTION_NAME IN\n")
_T(" (SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS
WHERE RDB$MODULE_NAME CONTAINING '%s')"),
udfFilename );
tr->ExecuteImmediate( cmd );

cmd.Format( _T("DELETE FROM RDB$FUNCTIONS WHERE RDB$MODULE_NAME
CONTAINING '%s'"), udfFilename );
tr->ExecuteImmediate( cmd );

tr->CommitRetaining();
}

UnlinkUDFFile( tr, _T("FreeAdhocUDF") );


HTH,
________________________________________________________
Richard Wesley Senior Software Developer Tableau
Software
Visit: http://www.trytableau.com/now.html