Subject Re: [IBO] Parameter in 'in' clause?
Author Oliver Sturm
On 06/19/02 16:47:19 +0200 Andreas Pohl <apohl@...> wrote:

>> Is there a way to have a parameter for an 'in' clause that expands to a
>> string?
>
> I solved that with help of a small udf:
>
> select * from t_table t where
> f_ibpparseint(t.artikelnr,:artikel)=1 and
> f_isparentstr(:stichw,(select stichwort from t_artikel a where
> a.nr=l.artikelnr))=1

Another question: How do you declare the UDF to the database? The problem
is, I have function now that I declare like this:

DECLARE EXTERNAL FUNCTION F_INTINLIST
INTEGER,
CSTRING(1024)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IntInList' MODULE_NAME 'czUDF.dll';

I can easily do

select F_INTINLIST(10, '1,10,3') from test

and it will return a 1. No problem. Now, the real query where I'd like to
use that would look like

select field from table t
where (F_INTINLIST(t.indexfield, :valididlist) = 1)

and that still doesn't work. I get a message from Interbase saying "SQL
Error code -804. Data type unknown." I suppose the problem is the CSTRING
parameter... same problem with IBO and Quickdesk. Did you use anything
different for the parameter?


Oliver Sturm

--
Fa. Manfred Dahlhoff - Buellenkothenweg 37a - 40229 Duesseldorf
Tel.: 0211-2202821 - Fax: 0211-2202822 - http://www.Manfred-Dahlhoff.de