We help IT Professionals succeed at work.

pl/sql parameter is null sometimes

enrique_aeo
enrique_aeo asked
on
129 Views
Last Modified: 2017-03-24
i have this sp

PROCEDURE MostrarVisitaDetalle
          (k_fecha_reg in varchar2,
           k_visnrodoc in varchar2,
.
.
.
             FROM xx.ACME vs
            where vs.visfecreg >= to_date(k_fecha_reg, 'DD/MM/YYYY')
              and vs.visfecreg < to_date(k_fecha_reg, 'DD/MM/YYYY') + 1
              and vs.visnrodoc = k_visnrodoc


As I should modify the code in the where, since the parameter is sometimes NULL
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
due to Boolean short circuit evaluation,  I'd recommend put the IS NULL checks on the left side of their  respective OR conditions.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.