Subject Re: [IBO] Parameterized WHERE clause
Author Svein Erling Tysvær
Hi Eric!

>Is there any way to parameterize this WHERE clause so it only gets
>prepared once and I don't have to re-enter the SQL?

When I saw your question, I thought about using the SQLWhereItems, but
didn't reply since I expected others to jump in. Having seen Geoffs reply,
I thought again and I think your particular problem can be easily solved by
introducing an extra parameter. Simply use

WHERE (ACTIVITYKEY=:AKEY OR 1=:MYBOOLEAN) AND AMODE=0

and set MyBoolean to 1 when you don't care about the value of ActivityKey.
The negative side of this approach is that no index for ActivityKey will be
used.

I hope I haven't gotten confused about null values this time (Null or True
ought to equal True).

HTH,
Set