Re: [Firebird-devel] Result set from where afield = afield

2017-07-10 Thread Dmitry Yemanov
10.07.2017 15:11, Paul Reeves wrote: I've also seen, in stored procedures, this sort of construct... where (( e.EMP_NO = :AEMP_NO ) OR ( :AEMP_NO IS NULL)) which, if the input parameter AEMP_NO is NULL will also behave as if a full result set was requested. ie, the stored procedure will

Re: [Firebird-devel] Result set from where afield = afield

2017-07-10 Thread Adriano dos Santos Fernandes
On 10/07/2017 09:11, Paul Reeves wrote: > While I was studying this sort of query: > > SELECT * FROM employee e > WHERE e.EMP_NO = coalesce ( ?, e.EMP_NO) > > it became obvious that if the parameter is null it resolves to this > sort of query: > > SELECT * FROM employee e > WHERE

[Firebird-devel] Result set from where afield = afield

2017-07-10 Thread Paul Reeves
While I was studying this sort of query: SELECT * FROM employee e WHERE e.EMP_NO = coalesce ( ?, e.EMP_NO) it became obvious that if the parameter is null it resolves to this sort of query: SELECT * FROM employee e WHERE e.EMP_NO = e.EMP_NO which produces the same result set as