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
last updated document
unknown_user3
I want to create a live report that can show me the name of the last updated document under a particular folder and its subfolders.Actually I want to use this livereport to know about some areas/folders when last updates were applied on their contents and since when they are just being used as read only.
Find more posts tagged with
Comments
Martin_Gäckler
What database are you using? The solution for oracle does not work with MS SQL Server.This is an example for Oracle DBselect d.* from dtree d, dversdata vwhere d.dataid = v.docidand d.versionnum = v.versionand v.filemdate = ( select max(filemdate) from dversdata where docid in ( select dataid from dtree connect by prior dataid = parentid start with dataid=%1 ))and dataid in( select dataid from dtree connect by prior dataid = parentid start with dataid=%1)
unknown_user3
Thanks for this query. We are using Oracle Database. I tested this query on some folders and was looking its working fine but on one folder its not showing results as expected.I run the sql query (as well as created live report)select name, MODIFYDATE, CREATEDBY, CREATEDATE from dtree d, dversdata v where d.dataid=v.docid and d.versionnum=v.version and v.filemdate=(select max(filemdate) from dversdata where docid in (select dataid from dtree connect by prior dataid=parentid start with dataid=%1)) and dataid in (select dataid from dtree connect by prior dataid=parentid start with dataid=%1)SQL> /NAME--------------------------------MODIFYDAT CREATEDBY CREATEDAT--------- ---------- ---------Test doc.doc05-MAR-08 1843154 05-MAR-08but actually the last modified file is Test_doc_1.doc 14/04/2009 03:49 PMany idea about that?
Martin_Gäckler
Hi,dtree.modifydate contains the last date the document was updated including metadata such as permissions, attributes an so on. My SQL checks the latest FILE since it checks max(dversdata.filemdate).If you are interested in changes of meta data too, you should use this SQL:select d.* from dtree dwhere d.modifydate = ( select max(modifydate) from dtree where dataid in ( select dataid from dtree connect by prior dataid = parentid start with dataid=%1 ) and subtype=144)and d.dataid in( select dataid from dtree connect by prior dataid = parentid start with dataid=%1)and d.subtype=144Hope this helps.Martin