Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Finding complete path of a document
Bob_Trieger_(fidinv01user6_-_(deleted))
I wrote a query to sort documents by date last accessed. Using the DATAID, how do I list the complete path to the document?I.e., doc BOB.XLS has DATAID = 119923How do I list that BOB.XLS is actually Enterprise/somefolder/anotherfolder/folderx/BOB.XLSThanks!!
Find more posts tagged with
Comments
John W. Simon, Jr.
Bob,I've done this for an Oracle system, don't know if this code will work on a SqlServer system or not (but I would guess not). I created the PL/SQL below. The first query (called cur_project) is the query where you find the object(s) you want to report the path of.Good Luck.------------------------------------------------------------------------- declare lv_dataid number(10); lv_version number(10); lv_parentid number(10); cursor cur_project is select dataid from dtree where parentid = 31749; cursor cur_path_back_to_top is select name from dtree start with dataid = lv_dataid connect by prior parentid = dataid; lv_name varchar2(255); lv_path varchar2(2000);begin open cur_project; loop fetch cur_project into lv_dataid; exit when cur_project%NOTFOUND; lv_path := ''; open cur_path_back_to_top; loop fetch cur_path_back_to_top into lv_name; exit when cur_path_back_to_top%NOTFOUND; lv_path := lv_name || ':' || lv_path; end loop; dbms_output.put_line('path is ==> ' || lv_path ); if cur_path_back_to_top%ISOPEN then close cur_path_back_to_top; end if; end loop; if cur_project%ISOPEN then close cur_project; end if;end;
John_Postma
Below is a similar bit of PL/SQL which will create a user defined function to return the full path to whatever DataID you pass to it. Just run this to create the function, then you can reference the function call in your select list, so it will also work in a LiveReport (eg select full_path(dataid) from dtree where .... )create or replace function full_path(p_dataid IN int) return varchar as l_fullpath varchar2(2000) :='None';begin for r_path in (SELECT NAME, dataid FROM DTREE START WITH dataid = p_dataid CONNECT BY PRIOR ABS(parentid) = dataid) loop if l_fullpath = 'None' then l_fullpath := r_path.name; else l_fullpath := r_path.name||':'||l_fullpath; end if; end loop; return l_fullpath;end;If you're using MS SQL Server there was a post earlier that showed a user defined function returning the path using Transact-SQL:
https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=3371354&objAction=view
Regards,John PostmaPrincipal Database SpecialistOpen Text Corporation
Mathias_Dresske
Your function is THE perfect solution for me.But...what are those
@-chars
for?*Mathias*
Martin_Gäckler
These damned '@' are replacements for the tab character. I don't know whether Livelink or the browser makes that replacements.