enrique_aeo
asked on
pl/sql parameter is null sometimes
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
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
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
due to Boolean short circuit evaluation, I'd recommend put the IS NULL checks on the left side of their respective OR conditions.