SQL> conn jyang/jyang@athena Connected. SQL> SQL> DECLARE 2 retb boolean; 3 BEGIN 4 retb := dbms_xdb.createfolder('/public/mydocs'); 5 commit; 6 END; 7 / PL/SQL procedure successfully completed. SQL> SQL> declare 2 bret boolean; 3 begin 4 bret := 5 dbms_xdb.createresource('/public/mydocs/emp_scott.xml','scott'); 7 commit; 8 end; 9 / PL/SQL procedure successfully completed. SQL> SQL> declare 2 bret boolean; 3 begin 4 bret := 5 dbms_xdb.createresource('/public/mydocs/emp_david.xml','david'); 7 commit; 8 end; 9 / PL/SQL procedure successfully completed. SQL> select owner, object_type from dba_objects where object_name='PATH_VIEW'; OWNER OBJECT_TYPE ------------------------------ ------------------ PUBLIC SYNONYM XDB VIEW SQL> select owner, object_type from dba_objects where object_name='RESOURCE_VIEW'; OWNER OBJECT_TYPE ------------------------------ ------------------ PUBLIC SYNONYM XDB VIEW SQL> desc resource_view Name Null? Type ----------------------------------------- -------- ---------------------------- RES SYS.XMLTYPE ANY_PATH VARCHAR2(4000) SQL> desc path_view Name Null? Type ----------------------------------------- -------- ---------------------------- PATH VARCHAR2(1024) RES SYS.XMLTYPE LINK SYS.XMLTYPE SQL> select count(1) from resource_view where any_path like '%mydocs%'; COUNT(1) ---------- 3 SQL> select * from resource_view where any_path like '%mydocs%'; RES -------------------------------------------------------------------------------- ANY_PATH -------------------------------------------------------------------------------- 2003-08-17T15:09:39.476000000 2003-08-17T15:09:39.476000000 mydocs en utf-8 text/plain 1 /public/mydocs 2003-08-17T15:09:39.758000000 2003-08-17T15:09:39.758000000 emp_david.xml us english utf-8 text/xml 1 /public/mydocs/emp_david.xml 2003-08-17T15:09:39.633000000 2003-08-17T15:09:39.633000000 emp_scott.xml us english utf-8 text/xml 1 /public/mydocs/emp_scott.xml SQL> select count(1) from path_view where path like '%mydocs%'; COUNT(1) ---------- 3 SQL> select * from path_view where path like '%mydocs%'; PATH -------------------------------------------------------------------------------- RES -------------------------------------------------------------------------------- LINK -------------------------------------------------------------------------------- /public/mydocs 2003-08-17T15:09:39.476000000 2003-08-17T15:09:39.476000000 mydocs en utf-8 text/plain 1 public mydocs mydocs AAAABA== T7gRyen7RVKUlSEWzkIcmQ== Wb2PxZ0pQAGUyUPa3gRt8w== /public/mydocs/emp_david.xml 2003-08-17T15:09:39.758000000 2003-08-17T15:09:39.758000000 emp_david.xml us english utf-8 text/xml 1 mydocs emp_david.xml emp_david.xml AAAAAA== Wb2PxZ0pQAGUyUPa3gRt8w== TnbokAPeSGaiGK/O4s49rQ== /public/mydocs/emp_scott.xml 2003-08-17T15:09:39.633000000 2003-08-17T15:09:39.633000000 emp_scott.xml us english utf-8 text/xml 1 mydocs emp_scott.xml emp_scott.xml AAAAAA== Wb2PxZ0pQAGUyUPa3gRt8w== bwnopSjsQ4S4iwAbdE1saA== SQL> SQL> -- Creates a link to an existing resource. SQL> -- This procedures is analogous to creating a hard link in UNIX. SQL> -- New entries created in path_view, not in resource_view, with the link name as the path. SQL> call dbms_xdb.link('/public/mydocs/emp_scott.xml','/public/mydocs', 2 'person_scott.xml'); Call completed. SQL> select count(1) from resource_view where any_path like '%mydocs%'; COUNT(1) ---------- 3 SQL> select count(1) from path_view where path like '%mydocs%'; COUNT(1) ---------- 4 SQL> select * from path_view where path like '%person%'; PATH -------------------------------------------------------------------------------- RES -------------------------------------------------------------------------------- LINK -------------------------------------------------------------------------------- /public/mydocs/person_scott.xml 2003-08-17T15:09:39.633000000 2003-08-17T15:09:39.633000000 emp_scott.xml us english utf-8 text/xml 2 mydocs emp_scott.xml person_scott.xml AAAAAA== Wb2PxZ0pQAGUyUPa3gRt8w== bwnopSjsQ4S4iwAbdE1saA== SQL> call dbms_xdb.link('/public/mydocs/emp_david.xml','/public/mydocs', 2 'person_david.xml'); Call completed. SQL> commit; Commit complete. SQL> SQL> call dbms_xdb.deleteresource('/public/mydocs/emp_scott.xml'); Call completed. SQL> call dbms_xdb.deleteresource('/public/mydocs/person_scott.xml'); Call completed. SQL> call dbms_xdb.deleteresource('/public/mydocs/emp_david.xml'); Call completed. SQL> call dbms_xdb.deleteresource('/public/mydocs/person_david.xml'); Call completed. SQL> call dbms_xdb.deleteresource('/public/mydocs'); Call completed. SQL> commit; Commit complete. SQL> SQL> spool off