Subject Re: Custom search string
Author Ali Gökçen
Hi Grant,


>ABC.SQL.Add('where Detect= :123);
>if X = true then ABC.SQL.Add('and Text1= :T1);
>if C = true then ABC.SQL.Add('and Text2= :T2);

try this:

where detect = :par1
and
(:X=false or text1= :T1)
and
(:Y=false or text2= :T2)
and
(:Z=false or text3= :T3)
and
(:X2=false or text4= :T12)
and
(:Y2=false or text5= :T22)
...

A little bool algebra... ;)

Good luck.

Ali

--- In firebird-support@yahoogroups.com, Grant Brown <grant@s...>
wrote:
> Hi Tim,
>
> Yes I did wonder about your first response :-)
>
> >> In your SP write
> >> EXECUTE STATEMENT :my_var_containing_SQL.
>
> Isnt that the same as just running a normal query at the client
end ?
>
> I cant seem to see the difference.
>
> How does one get at the result set using the EXECUTE STATEMENT
> :my_var_containing_SQL ?
>
> --
> Regards,
> Grant Brown
>
> Product Development Manager
> Phone : 02 4229 1185
> Mobile : 0412 926 995
> Email : grant@s...
> Web : www.sitedoc.com.au
>
> SiteDoc - Easy to Use - Powerful Results