<span style="font-size:18px;color:#ff0000;"><strong>sql server</strong></span>
-----------------------------------------------
update um_ctype set ctype = #ctype#,cname=#cname#,disable_flag = #disable_flag#,
disp_order=#disp_order# where ctid = #ctid#;
with qur_child
as
(
select uc.smid from UM_CLINK uc
where EXISTS (select ctid from um_ctype t where uc.pmid = #ctid#)
union all
select a.smid from UM_CLINK a
inner join
qur_child b
on ( a.pmid=b.smid)
)
update UM_CTYPE set disable_flag = #disable_flag# where EXISTS(select smid from qur_child where smid = ctid);
----------------------------------------
<strong><span style="font-size:18px;color:#ff0000;">oracle</span></strong>
------------------------------------------
begin
update um_ctype set ctype = #ctype#,cname=#cname#,disable_flag = #disable_flag#,disp_order=#disp_order# where ctid = #ctid#;
update UM_CTYPE set disable_flag = #disable_flag# where ctid in(select distinct smid from UM_CLINK start with pmid = #ctid# connect by prior smid=pmid);
end;