CREATE OR REPLACE function check_value(v_col in varchar2,
v_old in varchar2,
v_new in varchar2) return varchar2 is
Result varchar2(2000);
begin
if v_old is null and v_new is null then
result := '';
elsif v_old is null and v_new is not null then
result := v_col || '=' || v_new || '; ';
elsif v_old is not null and v_new is null then
result := v_col || '=' || v_old || '->DELETED; ';
else
if v_old = v_new then
result := '';
else
result := v_col || '=' || v_old || '->' || v_new || '; ';
end if;
end if;
return(Result);
end;
/
v_old in varchar2,
v_new in varchar2) return varchar2 is
Result varchar2(2000);
begin
if v_old is null and v_new is null then
result := '';
elsif v_old is null and v_new is not null then
result := v_col || '=' || v_new || '; ';
elsif v_old is not null and v_new is null then
result := v_col || '=' || v_old || '->DELETED; ';
else
if v_old = v_new then
result := '';
else
result := v_col || '=' || v_old || '->' || v_new || '; ';
end if;
end if;
return(Result);
end;
/

কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন