Subject Re: Why this query doesn't work?
Author fabiano_bonin
--- In firebird-support@yahoogroups.com, "Leyne, Sean" <Sean@B...> wrote:
> Fabiano,
>
>
> > select
> > *
> > from
> > table1
> > where
> > udf_digits(table1.code) like udf_digits(:code)
>
> 1) Are you sure that you want to use the "LIKE" operator?

Yes

> 2) Did you try:
>
> select
> *
> from
> table1
> where
> udf_digits(table1.code) like (udf_digits(:code) || '%')
>

Yes, it was my original query (with the '%' outside the parenthesis).
I just simplified it to post to the support list. It doesn't work
also.

where
udf_digits(table1.code) like (udf_digits(:code)) || '%'

Maybe it's some limitation that prevents the query below to work, too:

select * from rdb$database
where
cast(:a as integer) = cast(:b as integer)

>
> Sean