Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

%ROWTYPE and unuse some fields

448389Jul 30 2009 — edited Jul 31 2009
Hi 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;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2009
Added on Jul 30 2009
5 comments
985 views