%ROWTYPE and unuse some fields
448389Jul 30 2009 — edited Jul 31 2009Hi everybody.
I have a procedure to update a field and the parameter is %rowtype.
In this procedure I check is the new value is not null to known if the caller procedure have change it.
but if the caller want to update the field to NULL how to do ?
1- I try with a default value, but I don't want to update the field with the default value
2- I try to compare the default value by a impossible default value, but in some case we have not impossible default value
exemple
Update procedure
create or replace procedure p_upd_ename(p_emp emp%rowtype) is
begin
if p_emp.ename is not null then
update emp
set ename = p_emp.ename
where empno = p_emp.empno;
end if;
end p_upd_ename;
Caller
declare
t_emp emp%rowtype;
begin
t_emp.empno:=1;
p_upd_ename(t_emp);
end;
/