Cannot Delete Non-Empty Folder From Resource_View
651348Jul 14 2009 — edited Jul 15 2009Good Morning.
I have over 15,000 XML files listed under a leaf-folder with RESOURCE_VIEW. I need to remove them all and replace them with corrected versions.
I found the following script in the 10.2 XDB Developers Guide which runs successfully, however the files are not removed - go figure.
Would someone who has worked with RESOURCE_VIEW and PATH_VIEW please point me in the correct direction that I may complete this task. The script is as follows.
------------------------------------------------------------------------------------------------------------------------------------------------
DECLARE
CURSOR c1 IS
SELECT ANY_PATH p FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/FADS',1) = 1
AND existsNode(RES, '/Resource[Owner="FADS"= 1
ORDER BY depth(1) DESC;
del_stmt VARCHAR2(500)
:= 'DELETE FROM RESOURCE_VIEW WHERE equals_path(RES, :1)=1';
BEGIN
FOR r1 IN c1 LOOP
EXECUTE IMMEDIATE del_stmt USING r1.p;
END LOOP;
END;
COMMIT;
/