declare in_productnum varchar2(50);
in_username varchar2(50);
in_realname varchar2(50);
begin
FOR dtl IN (
select t.product_num from scm_mtl_catalog_tbl t2
left join (SELECT a.*,a.rowid,
RANK() OVER(PARTITION BY a.PRODUCT_NUM ORDER BY a.INSERT_DATETIME desc) RK
FROM scm_ws_sc_catalog_change_tbl a
where 1=1
--and a.INSERT_USER_NAME = 'SCM'
) t
on t.Rk = 1 and t.product_num = t2.mtl_cat_code
where
1=1
and (DECODE( trim(t.valid_flag),'X','N','','Y') != t2.enabled_flag)
and t.insert_user_name = 'PAG_MTL_CATAlOG.import_sc_catalog'
) LOOP
in_productnum :=dtl.product_num;
in_username :='wangjing32';
in_realname :='王静';
-- Call the procedure
pag_mtl_catalog.enablecat(in_productnum ,
in_username,
in_realname );
end Loop;
end;
在plsql的test窗口用for循环
最新推荐文章于 2024-02-29 14:30:54 发布