Override PL-SQL condition

1

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?

    
asked by anonymous 14.07.2015 / 13:42

1 answer

0

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)
    
14.07.2015 / 13:58