Subject | Re: [firebird-support] Problem with query parameter |
---|---|
Author | Anderson Farias |
Post date | 2009-03-10T15:51:27Z |
Hi,
I for instance aways do that on an limited amount of records selected by a
short period of time, so there's no performance problem (date fields have
indexes that are used on the query) -- this is very usefull to my
procedures, eg:
for select <fields> from table
where date_field between :initial_date and :final_date
and (:some_param is null or some_field=:some_param)
into ...
I just suppose the OP's example was very simple to make it easy to get to
his point.
=)
Regards,
Anderson Farias
>I accept that you can do that, but what isThat's another issue. The point is it *is* possible.
> the performance like with these either/or statements? And what about
> indexes with nulls?
I for instance aways do that on an limited amount of records selected by a
short period of time, so there's no performance problem (date fields have
indexes that are used on the query) -- this is very usefull to my
procedures, eg:
for select <fields> from table
where date_field between :initial_date and :final_date
and (:some_param is null or some_field=:some_param)
into ...
I just suppose the OP's example was very simple to make it easy to get to
his point.
=)
Regards,
Anderson Farias