SELECT LPAD(' ', LEVEL * 5)|| NAME AS "OBJECT_HIERARCHY", LTRIM(SYS_CONNECT_BY_PATH(NAME,': '),': ') AS "PATH"FROM DTREEWHERE SUBTYPE IN (O, 144) -- 0 = FOLDER, 144 =DOCUMENTSSTART WITH PARENTID = -XXXXX –- THIS WILL BE INVERSEOF THE OBJECT ID OF THE PROJECT WORKSPACECONNECT BY PRIOR DATAID = PARENTID
From: eLinkDiscussion: Livelink LiveReports Discussion[mailto:livereportsdiscussion@elinkkc.opentext.com] Sent: Friday, November 02, 20077:33 AMTo: eLink RecipientSubject: Projects and itsdescendants?
Projects and its descendants?
Posted by pfizerdevteam (Developers, Pfizer) on 11/02/2007 10:30 AM
Hi all, I am currently working on a report for Oracle. I would like the best approach to list all folders and documents in its structured order as it appears through the interface. I am not interested in versions at this point. Any assistance much appreciated. Thanks
Leave it to Jim to ask me the toughquestions! J
I don't have any code readily availablefor SQL Server, but in MSSQL Server 2000/2005 it requires creating a recursive storedprocedure or function and a temporary table to produce the same output as Oracle'sbuilt-in SYS_CONNECT_BY_PATH and START WITH/CONNECT BY PRIOR functions. Thereis an article with examples on how to do this located at http://blogs.conchango.com/christianwade/archive/2004/11/09/234.aspx.A technical article for SQL Server 2005 can be found on Microsoft's site at http://msdn2.microsoft.com/en-us/library/ms186243.aspx.There is also an example in the Livelink Advanced Schema and LiveReports coursemanual for those who have taken the course.
From: eLinkDiscussion: Livelink LiveReports Discussion[mailto:livereportsdiscussion@elinkkc.opentext.com] Sent: Monday, November 05, 20079:39 AMTo: eLink RecipientSubject: RE RE Projects and itsdescendants? 2
RE RE Projects and its descendants? 2
Posted by grmmun02user8 (Coursey, Jim) on 11/05/2007 12:39 PM
In reply to: RE Projects and its descendants? 2
Posted by esaavedr (Saavedra, Eric) on 11/05/2007 12:28 PM
Message from Coursey, Jim <jim.coursey@ngc.com> via eLink
What would the code look like for MS SQL Server?