Subject Re: Possible to write this in a way that indices will be used
Author Doru Ilasi
Sorry Maya,
Sasha is very right. Glasses won't help me to read more carefully your
What was I suggested to use were usefull if your querry were :

select blah..,
from MyTable D
where ((D.SuplCde = :ISupplierCode) or (D.SuplCde is null))

In your situation it looks like you supply the right querry. If I
remember well, trying to put coalesce in equation will throw the
indices out.

Getting null's out from client or from procedure would not help
either, because you may or may not send a parameter - that is a mean
that a field may or may be not in the querry.

Will wait to see the thread ideas...

--- In, "Maya Opperman" <maya@...> wrote:
> >Doru wrote:>
> >If you are using Firebird 2+ Testing DISTINCTness will be a nice way
> >to go :
> >
> OK, so ((D.SuplCde = :ISupplierCode) or (:ISupplierCode is null))
> would change to ((D.SuplCde is not distinct from :ISupplierCode))
> to achieve the same results?
> Ie. if D.SuplCde is 'ABC' and ISupplierCode is 'ABC', result will be
> if D.SuplCde is 'ABC' and ISupplierCode is NULL, result will be
> TRUE??
> if D.SuplCde is 'ABC' and ISupplierCode is 'XYZ', result will be
> Is that right?
> Thanks
> Maya