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
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
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