Paths of directory tree market

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0

I have an external table returns a list of directory paths. Is there a built-in way to turn this into a foot of the tree? I would like to use the tree in an apex application market, where the issue. I had considered splitting on each node with regexp_substr and then do everything manually, but I guess there is something already done in this area, although as the forums search returned unanswered.

WITH directory_listing AS 
  (SELECT '/root' 
     FROM DUAL
   UNION
   SELECT '/root/level1/level2/level3'
     FROM DUAL
   UNION
   SELECT '/root/level1'
     FROM DUAL
   UNION
   SELECT '/root/level1/level2'
     FROM DUAL)
SELECT * FROM directory_listing

Returns:

LIST

--------------------------

/ root

/ root/level1

/ root/Level1/Level2

/ root/Level1/Level2/Level3

I wish the tree she can walk this list, so to be able to refer to a 'level' and of course the tree market, so connect by etc..

Hello

Thanks for posting the sample data.  Don't forget to post the exact results you want from the given sample data, too.

Given a table like directory_listing, are you trying to create a table like this

NODE_ID PARENT_ID NODE_NAME LISTING

---------- ---------- ---------- --------------------------

1 root/root

2 1 level1/root/level1

3 2/root/level1/level2 level2

4 3 level3/root/level1/level2/level3

?  If so, here is one way:

Tree of CREATE TABLE AS

WITH got_node_id AS

(

SELECT list

SUBSTR (ad

1 + INSTR (ad

, '/'

-1

)

) AS node_name

ROW_NUMBER () OVER (ORDER BY NULL) AS node_id

OF directory_listing

)

SELECT c.node_id

p.node_id AS parent_id

c.node_name

c.listing

OF got_node_id c

LEFT OUTER JOIN got_node_id p ON p.listing | '/'

|| c.NODE_NAME = c.listing

;

This means that registration is unique in your original table.  Individual node_names need not be unique.  In other words, it is normal to have both "/ root/level 1/level 2 ' and ' / root2/level 1/level 2" where "level1" and "level2" are duplicated.

It is convenient to have the liisting of your original table column.  However, if you do any DML on the table of the tree, then it will be difficult to keep specific list column, and you can always build using SYS_CONNECT_BY_PATH.  Decide for yourself whether or not you want the list column in the table from the tree.

Tags: Database

Similar Questions

  • Cannot delete directory tree

    I had a request are able to convince Windows to screw up its file structure in two folders. When I try to delete the directory runaway tree I get the message error "the folder contains items whose names are too long for the Recycle Bin.  After choosing the option Yes it is followed by another error message "the name of the source file is larger that can be supported by the file system. Try to move to a place that has a way more short name, or try renaming to shorter name (s) before performing this operation. ', then' the file name may be too long for the destination folder. You can shorten the file name and try again, or try a location with a shorter path "."
    The end result is that the directory tree cannot be deleted.
    I think there may be a third-party tool out there to remedy this wrong behavior of the BONE from the window.
    I had hoped that Microsoft would provide a way to correct that a fault that is OS allowed to occur.

    I had a request are able to convince Windows to screw up its file structure in two folders. When I try to delete the directory runaway tree I get the message error "the folder contains items whose names are too long for the Recycle Bin.  After choosing the option Yes it is followed by another error message "the name of the source file is larger that can be supported by the file system. Try to move to a place that has a way more short name, or try renaming to shorter name (s) before performing this operation. ', then' the file name may be too long for the destination folder. You can shorten the file name and try again, or try a location with a shorter path "."
    The end result is that the directory tree cannot be deleted.
    I think there may be a third-party tool out there to remedy this wrong behavior of the BONE from the window.
    I had hoped that Microsoft would provide a way to correct that a fault that is OS allowed to occur.

    Place the blame in the wrong place.

    Too many times have I given ridiculous people with file names and folders structures.

    You may be able to create a link to a directory close to the files you want to learn to (probably something similar was done by the application that supposedly does this) using something like the old command SUBST to start a directory/drive (or give the impression that even when it starts) at a different point than the original reality (google for the subst command.)

    You could read this too...

    http://www.bryantwebconsulting.com/blog/index.cfm/2012/1/19/getting-around-Windows-7-destination-path-too-long-error-when-deleting-files

  • How can I remove a directory tree that is too deep?

    I used ROBOCOPY to copy the contents of theC:\USERS\ALL USERS in an external drive USB FAT32.  I forgot to include the /XJ switch and, therefore, now have a directory tree that continues to repeat the Application data in a subdirectory.

    When I try to delete it, I get an error message:
    "The names of source files are larget that is supported by the file system."  Try to move to a location that has a shorter path name, or try renaming to name more short (s) before performing this operation. »

    I can't move any part of the directory tree or I can rename it.

    Anyway is to remove the directory tree without having to refomat the player?

    Found this utility that will at least give you an idea if you delete.

    http://www.purgeie.com/delinv/

    JS

  • "User directory tree HAND "?

    Hello

    I had to reinstall the operating system and now when a user connects to a directory tree is created as a "user. HAND '. Why is this and I correct?

    Thank you
    Doug

    If "user. MAIN", user is the name of the logged in user and MAIN is the name of the computer, and this directory is created in the"\Documents and Settings"folder, then this is probably the result of a corrupt user profile.  To retrieve, select from the following items:

    "How to recover damaged Windows XP user profile"
      <>http://support.Microsoft.com/kb/555473 >

    "How to copy data from a corrupted to a new profile in Windows XP user profile"
      <>http://support.Microsoft.com/kb/326688 >

    Usually corrupt profiles are accompanied by corruption of system files, so an operation "chkdsk" with the /F or/r option is a step in careful follow-up interview:

    "How to perform disk error in Windows XP check"
      <>http://support.Microsoft.com/kb/315265 >

    HTH,
    JW

  • Windows directory tree

    Hello:

    I'm running Vista 32 bit Home Premium ofn a HP laptop.

    I had opened a window showing disks on my computer, via Start > computer.

    At that time, he had two panels in the main window.

    The right panel shows the list of drives.

    The left panel shows a directory tree.

    I clicked on something about high to the left of the left panel,

    and the information displayed in the left panel changed to a list of Favorites.

    How can I get the directory tree in the left panel?

    Thanx

    DaleB

    Hello:

    I found the solution:.

    If you click on Start > computer and lool at the list or Details "view,"

    in the right panel, you will see a list of your disks.  In the left panel.

    you will see a directory tree.  If you do not, in the left panel, look at all

    the descent of the upper part of the left panel.  There, you will see

    the term files, with one pointing triangle (arrow).

    Click it, and the directory tree will reappear.  To hide the

    directory tree, click Folders at the bottom of the list to the top

    in the left panel.  Clciking on records is just a switch for hide/show

    the directory tree.

    DaleB

  • WebCenter form recognition {path} WebVerifier directory name is invalid

    Hello

    I am facing the below question while trying to open Web Center form check using web check.

    {Path} WebVerifier directory name is invalid. Please contact your system administrator.

    Operating system: Windows Server 2008 R2

    Software: Oracle WebCenter recognition form 11.1.1.8.0

    find the screenshot attached error and help with the solution.
    WFR_WebVerifier_Invalid_directory_Error.jpg

    Thank you

    Sanjeev

    Hi all

    Thanks for the reply, that I tried everything but unfortunately unable to solve the problem.

    Finally, I followed the steps below to solve the problem of invalid path of Web Client Verifier.

    (1) I deleted the project and work, entry I created from the respective table.

    (2) stop the time Service perform form recognition Web Center.

    (3) change the AP project directory and still set up the designer, the auditor and the auditor of WebClient, setting of auditor of the IIS Web server.

    so just want to share with you people.

    Thank you

    Sanjeev

  • Create a directory tree: how to call a global function from inside a for loop

    Hello

    I am trying to create a workflow that will create a directory tree in vCenter.

    Concept:

    Basically, I am trying to execute nested for loops for each level of the tree to the caller a global tree.

    Problem:

    The 1st loop for works and creates the file 'Dev '.  The second loop for does not work with error message:

    [19:16:16.219 2013-06-27] [I] building Dev folder
    [19:16:16.474 2013-06-27] [I] directory Built: Dev
    [19:16:16.476 2013-06-27] [I] the records building servers
    [19:16:16.480 2013-06-27] [I] TypeError: cannot find the createFolder function in dev object. (Workflow: TEST_TNG_New_Site_Folder_Structure / Scriptable task (item2) #36)

    I think it has to do with JavaScript not being not able to call a global function in a nested object (I'm not a programmer and don't know JavaScript, so don't shoot me on that :)

    Code: (will clean this up once I do work)

    var folderBase is ['Dev', 'DMZ', 'Prod', 'UAT'];.

    var folderT1 = ["servers", "Jobs"];

    var folderT2 = ['Window', 'Linux'];

    var folderT3 is ["Repo2', 'Repo3', 'Repo1', 'Repo4'];.

    var folderT4 is ["T1", "T2", "T3"];.

    Create the files folderBase level

    for (var i = 0, l = folderBase.length; i < l; i ++) {}

    var rootFolder = parentFolder;

    buildFolderTree (folderBase [i]);

    Create the files folderT1 level

    for (var j = 0, l = folderT1.length; j < l; j ++) {}

    var rootFolder = folderBase [i];

    buildFolderTree (folderT1 [j]);

    Create the files folderT2 level

    for (var k = 0, l = folderT2.length; k < l; k ++) {}

    var rootFolder = folderT1 [j];

    buildFolderTree (folderT2 [k]);

    Create the files folderT3 level

    for (var x = 0, l = folderT3.length; x < l; x ++) {}

    var rootFolder = folderT2 [k];

    buildFolderTree (folderT3 [x]);

    Create the files folderT4 level

    for (var y = 0, l = folderT4.length; y < l; y ++) {}

    var rootFolder = folderT3 [x];

    buildFolderTree(folderT4[y]);

    }

    }

    }

    }

    }

    function buildFolderTree (folderName) {}

    System.log ("Building folder" + folderName);

    rootFolder.createFolder (folderName);

    System.log ("directory of frame:" + folderName);

    }

    Any help will be appreciated.

    Thank you

    B

    Hello

    The createFolder() method returns the object VcFolder to the folder just created, for the new file to be used immediately.  Here is how I modified the code:

    Create the files folderBase level
    for (var i = 0; i)
    var newBaseFolder = buildFolderTree (parentFolder, folderBase [i]);
    Create the files folderT1 level
    for (var j = 0; j)
    var newT1Folder = buildFolderTree (newBaseFolder, folderT1 [j]);
    Create the files folderT2 level
    for (var k = 0; k)
    var newT2Folder = buildFolderTree (newT1Folder, folderT2 [k]);
    Create the files folderT3 level
    for (var x = 0; x)
    var newT3Folder = buildFolderTree (newT2Folder, folderT3 [x]);
    Create the files folderT4 level
    for (var y = 0; y)
    var newT4Folder = buildFolderTree (newT3Folder, folderT4 [y]);
    }
    }
    }
    }
    }

    function buildFolderTree (parentFolderObj, folder_name) {}
    System.log ("Building folder" + folderName);
    var newFolder = parentFolderObj.createFolder (folderName);
    System.log ("directory of frame:" + folderName);
    return NewFolder;
    }

  • Size of directory trees

    Is there a way to see the directory sizes of trees at the same time?

    It's your lucky day...

    http://www.Jam-software.com/treesize_free/

  • Get the path of directory name

    Hello

    I need to read the path of the directory 'directory name '. I know that I can read this dba_directories but it requires the grant of the sys user...

    Are there other options to get the path of the directory of the directory name.

    I need the directory path in the java stored procedure which concatenates PDF files on disk to the db and then store in BLOB table field...

    Not really, either dba_directories or all_directories, where information is queryable of.

  • Path of directory "DELETE" of MDS

    Hello

    Can someone tell how can I do to remove a path of MDS?

    During import / export of LDAPUser.xml, we ended up accidentally create a version misnamed/metadata/iam-features-ldap-sync.
    Since then, we corrected the error & the new file to the right place.

    I would store the paths and get rid of this incorrect path.

    I understand from previous posts that an option is just to remove the MDS_PATHS records that refer to the way of strike's fault, but I'm not too keen on what I fear that it might cause other problems or let it hang on the references to the typo.

    Is there another way to remove the path of strike's fault? i.e. something like weblogicDeleteMetadata I can run for the directory rather than just the files in the directory?

    Thank you.

    Remove entries from the MDS database. Find all entries where the path is same as you wish remove. As long as you have all the files in them, you should be fine.

    -Kevin

  • Path of Directory issues

    Hello
    I am facing a problem of code below, can someone pls comment what's wrong here?
    the name of the directory is to get it by calling the function which is source of errors. using 11 g
    SQL> select pk_utilities.fn_datadirect from dual;
    
    FN_DATADIRECT
    --------------------------------------------------------------------------------
    /tmp
    
    
    SQL> select * from all_directories;
    
    OWNER                          DIRECTORY_NAME                 DIRECTORY_PATH
    ------------------------------ ------------------------------ --------------------------------------
    SYS                            LOGDIRECTORY                   /tmp
    SYS                            DATADIRECTORY                  /tmp
    
    
    SQL> declare
           fd utl_file.file_type;
        begin
            fd := utl_file.fopen('DATADIRECTORY','test.txt','w');
            utl_file.put_line(fd,'This is a test');
            utl_file.fclose(fd);
        end;
    /
    
    PL/SQL procedure successfully completed.
    
    
    -------- Below code is throwing issue-------------
    
    
     declare
      
           fd   utl_file.file_type;
      
           direct varchar2(200) := pk_utilities.fn_datadirect;
      
            begin
      
                fd := utl_file.fopen(direct,'test.txt','w');
               utl_file.put_line(fd,'This is a test');
            utl_file.fclose(fd);
              end;
    /
    declare
    *
    ERROR at line 1:
    ORA-29280: invalid directory path
    ORA-06512: at "SYS.UTL_FILE", line 41
    ORA-06512: at "SYS.UTL_FILE", line 478
    ORA-06512: at line 9
    Published by: user520824 on July 27, 2010 04:55

    Published by: user520824 on July 27, 2010 04:57

    You need to replace the first arg of UTL_FILE with the directory object name... no other choice, I could see right now
    Make sure you do right all of access privileges

  • back or a script for recursivley travel through a directory tree and make a shortcut relitive to a file located in each directory

    Nice day

    I have a bunch of files that are located on a network computer that has a shared parent directory.  I need to create a shortcut to the .exe which are in each directory.  There are more than 1000 directories, so the creation of all the shortcuts by right-clicking on each one of them is out of the question.  Shortcuts created to point to the original files, even though I'm moving shortcuts to another system.  You should be able to run the exe file from the network share from any system on the network.  I use robocopy with like to copy the directory structure and all the files in each directory except the .exe due to their size.  I wish that the finished product to fit on a USB key so that I can plugin for any system and then run the program pointed to by the shortcut.  Basically, it will be a reference in offline mode that can be used on a system that is online.

    Thanks in advance for any help.

    OK I will propose it.  Wasn't quite sure were put it.  Thank you

  • Under media folder directory tree - is it possible

    Hi all

    I use the SMIL file to manage the f4v files:

    < smil >
    < head >
    < base meta = "rtmp: / vod /" / >
    < / head >
    < body >
    <>switch
    < src = "video mp4:intro_300.f4v" system-bitrate = "300000" / > "
    < src = "video mp4:intro_500.f4v" system-bitrate = "500000" / > "
    < src = "video mp4:intro_700.f4v" system-bitrate = "700000" / > "
    < src = "video mp4:intro_1000.f4v" system-bitrate = "1000000" / > "
    < src = "video mp4:intro_1500.f4v" system-bitrate = "1500000" / > "
    < / switch >
    < / body >
    < / smil >

    It works fine, as long as I keep all f4v files vod/media/default folder. I need to organize my support structure somehow because it's more than 400 files. How can I do this? I tried:

    (1) creation of directories under vod, i.e. vod/test1 with < base meta = "rtmp: / vod/test1 /" / > and placement of files f4v directly in test1

    (2) the same f4v files but put under test1/vod/media /.

    It does not work. is it possible to place individual f4v files in different directories under vod / root?

    Please, advise.

    Thank you

    Andy

    Instead of making all these combinations, you keep .smil file such as she.

    Place your multimedia files anywhere where you want to be and just set up all these places in your VOD application Application.xml.

    Say for example you want to have media files in the folder "test1" and "test2" under VOD media file, you can do more, open Application.xml and make following changes

    /; \applications\vod\media\test1

    /; \applications\vod\media\test2

    If your application. XML would look like this:

    / ; ${VOD_COMMON_DIR}

    / ; ${VOD_DIR}

    /; \applications\vod\media\test1

    /; \applications\vod\media\test2

    So no need to change your .smil file, you can get it works this way.

  • Impossible to import the directory NFS: no expandable tree

    I use Lightroom 4.3 on Mac OS X Lion mountains (10.8.1).

    I cannot import files of a directory mounted through NFS, because records are not nodes of rocker, so I can't navigate the tree on my existing photo library.  It is not practical or desirable to import the complete NFS file system.

    I got to the origin of the file system mounted with the following options:

    FreeNAS: / mnt/vol_home/nfs_home on/Volumes/home (nfs, nodev, nosuid, automatically, nobrowse)

    And while I can see the root of the file system in the left side of the import window, and directories have small icons of file next to them, the small triangular rockers beside them are grayed out.  If I chose a directory and checked "include subfolders", then Lightroom would be made through the tree and show me all the images.  But I don't want to import my entire file system.  I need browse my photo directory tree, but the rockers are "grayed out."  It is difficult to see them dimmed when the background is grey too, but they are there, weak as they are.

    So, I thought that maybe the "nobrowse" option was something to do with the inability to navigate.  I used "NFS Utility" to remove the 'nobrowse' option and back up the file system.  It is now mounted with the following options:

    FreeNAS: / mnt/vol_home/nfs_home on/Volumes/home (nfs, nodev, nosuid, noatime)

    And while I can see the root of the file system in the left side of the import window, and then the directories have icons of file bit next to them, [most of] rockers next to them are still grayed out.  Here is a screenshot of the import window, alongside a Finder window, which of course allows me to open the rockers and navigate correctly.  The fact that Finder works implies to me that this is not a permissions problem.  Of course, I can also 'cd', using the terminal command line.  The problem of navigation seems to be limited to the Lightroom application.

    screenshot 2013-01-05 at 12.37.31 AM.png

    I hope that you can see on the screenshot, that only the folder 'Michel' has a working rocker.  The other rockers are grayed out (which is really hard to see).  I need to navigate under "farid", but cannot.   Finder can open the rocker 'family' and can open the subfolders under "farid" very well.

    Why lightroom refuses to let me open these files?

    Thanks in advance.

    I discovered a way to get Lightroom to navigate my NFS directory!  Using the help, I learned here:

    http://feedback.Photoshop.com/photoshop_family/topics/lightroom_4_3_import_from_and_to_nfs _mounted_filesystem_does_not_work

    I discovered that not only I need to use a non-standard mount point (I chose "/ nas"), but I also had to come up with the option 'rdirplus' (aka 'ReaddirPlus NFSv3 use feature').  I used the advantage German 3rd package 'NFS Manager' to help me assemble and disassemble quickly, while the activation and the deactivation of the options on the left and right to try to understand this problem.  It also allows me to define as a "montage".  Before Mac OS X 10.8 (mountain lion), there was a GUI in disk utility to allow me to specify the NFS mounts, but from mountain lion, the button has disappeared, for unclear reasons.

    In any case, I got lightroom to navigate my NFS server by mounting on the file, and specifying the "rdirplus" option in the mount command.

  • WinXP - which seems to be a corruption of directory

    Hi all

    I ran into a problem with access to some files (perhaps due to the update of a program existing... not sure). Am running WinXP SP3. Here's what I found so far:

    1. I have a subfolder that contains PDF files. If I'm in WinExplorer and I right click on a file name, I get a very short list of options. "Adobe Reader" and open Adobe Acrobat"are the first 2 (if I click on 1 of the Adobe options, nothing happens. However, if I open Adobe Reader and then try to open the file, I get "the name of the file above is not valid"... it's the same anme file I see in WinExplorer). I get about 4 or 5 other choices, but no editing options (cut, copy, paste, etc.). If I look at an adjacent folder (same level in the directory tree), if I right click on any one of these files, I get a long list of options (options above Adobe, AVG, WinZip, etc. and options publishing.

    2. in the folder 'wrong', if I slow click twice on the file, 1st time that the name of the file is highlighted, 2nd click on get a beep as a mistake and nothing happens. Cannot change the name. I also can't exceed the copy/edit, either. If I do a Dir /X command, I can see the long names and short names. However, I can't Reader to open the file for each name (when I tried yesterday, I thought I could at least open with a short name). I also downloaded s good file with a name short but was unable to open it.

    3. I did another folder plu high in the tree, believing that the problem could be related the number of characters allowed for the path/file name (although this has never been a problem before). I could not yet move the wrong files. This is the strange and possibly critical thing about it. After that I restored this new folder, I then tried to transfer file (including 3 subfolders) to the same directory level of the file with the wrong files. The result was that filenames in this set of folders was placed under the long file name short file name (8.3, 6 characters followed by "~ 1"). I tried to change the file names to long file names and, while I could change the name of the file, I was limited as to how many characters, I might add (maybe 8 or 9).

    4. I have a disc into a drive C and D. This problem with PDFs is on my drive D. I also noticed that when I go to the station of work/properties and click the System Restore tab (all other tabs appear to work normally), I'm getting poured into request if I want a debugging session in Visual Studio... something about "an unhandled win32 exception occurred in run32dll.exe []. I tried system restore running from the command prompt and got the same results.

    It seems that it is a sort of directory corruption, specifically related to the long short name/parameters by name. According to what I've done so far, I downloaded new versions of some files, and as long as I do not place these files/folders in the tree where are the folder (s)? 'bad' files are OK. I am interested to know if there is a way I can 'restore' files to a healthy state. I ran antivirus programs and malware and that you have not seen serious infections. I also ran chkdsk but no serious disk errors were noted.

    Thanks in advance for any help that anyone can provide.

    See you soon... Steph

    Hello stephr1,

    Thanks for the return of the response.  I have included a link below from the Microsoft MSDN site which can help, I hope.  Please let us know status.

    MSDN:

    http://msdn.Microsoft.com/en-us/library/aa365247 (vs.85) .aspx

    Thank you

    James,

    Thanks for (finally ;) to return to me.)

    I solved two problems (I also had a situation with no enforcement system restore and enter directly into a session attempt to debug with Visual Studio).

    As for the question of length of path/file name... Somewhere along the way, I have to (intentionally) increased the length of 1 or 2 of path names without realizing the impact that would have on the lower level directories and/or files. This apparently caused problems, I don't see until recently. I have reduced since the no. tanks in some of the names of path in addition to "flattening" the directory structure a bit to avoid this problem in the future. So far, it has worked.

    Regarding the issue of the restoration of the system... the original problem seems to be related to access to the privileges of the folder System Volume Information hidden on the hard drives. To fix things, I temporarily changed the privileges to access these records to the appropriate volumes, their fame in "System Volume Information2" and then tried to run the system restore. When I did this, System Restore created new system volume files (without the ' 2') and then I deleted the files renamed (with a ' 2'). Everything is back to normal.

    I wonder if we the recent updates of Windows XP made "unannounced adjustments" to the access privileges for these files, and that caused my problems.

    Anyway, things are back to normal. I would like to offer congratulations to this forum to help me solve problems, but it seems that I have pretty well it matched out on mine (a suggestion initially was to reload the system... not the kind of response I can understand :(  However, I appreciate you and anyone else who tried to help me. Thank you.

    See you soon... Steph

Maybe you are looking for