Subject Re: [firebird-support] Why this query doesn't work?
It is because input parameter of your UDF is CSTRING.
Rewrite UDF to use one of Firebird's native types, CHAR or VARCHAR.

Ivan

----- Original Message -----
From: "fabiano_bonin" <fabiano@...>
To: <firebird-support@yahoogroups.com>
Sent: Monday, July 11, 2005 7:22 PM
Subject: [firebird-support] Why this query doesn't work?


> FB 1.5.2
>
> select
> *
> from
> table1
> where
> udf_digits(table1.code) like udf_digits(:code)
>
> An error was found in the application program input parameters for the
> SQL statement.
> Dynamic SQL Error.
> SQL error code = -804.
> Data type unknown.
>
> The error happens in IBExpert and IBObjects also.
>
> Here is the DDL of the udf:
>
> DECLARE EXTERNAL FUNCTION UDF_DIGITS
> CSTRING(254)
> RETURNS CSTRING(254)
> ENTRY_POINT 'udf_Digits' MODULE_NAME 'tbudf'
>
> Regards,
>
> Fabiano.