I have a condition, like this one, in a query .
If you receive the parameter empty or 0, you would like this condition to cease to exist, or be aborted, for query to fetch all doctors.
where CD_MEDICO_CIRURGIAO = :medico
How to do it?
I have a condition, like this one, in a query .
If you receive the parameter empty or 0, you would like this condition to cease to exist, or be aborted, for query to fetch all doctors.
where CD_MEDICO_CIRURGIAO = :medico
How to do it?
The right thing is for you to first check if the doctor's code exists ( :medico
) and then yes enter the condition.
But this should resolve if you can not get the first option ( NVL )
where CD_MEDICO_CIRURGIAO = NVL(:medico, CD_MEDICO_CIRURGIAO)