begin
for cur_dept in (select SLCATALOG_ID from T_GIS_SLCATALOG) loop
UPDATE T_GIS_SLCATALOG
SET PATH =
(SELECT listagg(SLCATALOG_ID, ‘,‘) WITHIN GROUP (ORDER BY SLCATALOG_ID)
FROM (SELECT *
FROM T_GIS_SLCATALOG
START WITH SLCATALOG_ID = cur_dept.SLCATALOG_ID
CONNECT BY PRIOR PARENT_ID = SLCATALOG_ID))
WHERE SLCATALOG_ID = cur_dept.SLCATALOG_ID;
end loop;
end;
时间: 2024-10-11 16:56:04