Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on SQL Query ofr Document Reporting

Status
Not open for further replies.

baraqatax

IS-IT--Management
Nov 22, 2009
23
CA
Hi guys, I'm developing SQL query to create LiveReport to generate all created and modified documents from 1 folder in a weekly period.

I have succeeded to get all users who created the documents. However, my question is how to get username who modified the documents since there is no "ModifiedBy" field in DTree table. Below is my query.

select d.dataid, d.name, to_char(d.createdate, 'MON DD, YYYY HH24:MI:SS') as CREATEDATE, k.lastname, k.firstname
from DTree d
inner join kuaf k on d.createdby = k.id
where ((d.CreateDate>=(sysdate-7)) and (d.CreateDate<=sysdate))
and d.subtype = 144
connect by prior dataid = parentid start with parentid = <parentid>
order by d.name asc

Does anyone know how to get the users who modified documents from this query?

Thanks!
 
what do you mean by modified ? do you mean a new version added or something like permissions changes, category changes etc.

the DTREE.ModifyDate column may give you what you need.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Thanks for your prompt response, Greg. Appreciate it!

I mean the DTree table doens't have "ModifiedBy" field, only "CreatedBy" field. Do you know how to get the ModifyBy attribute? What table should I join with DTree and also KUAF?

 
I'm using Livelink 9.7.1 with Oracle 10g DB.
 
dtree has a column modifydate in livelink 9.7.1 and any other previous versions.On initial creation createdate and modifydate are set with the same time stamp.modifydate is used to track any changes to the node(it could be anything like new versions,permissions,category changes etc).The version table dversdata has also 4 dates in them to track versionable items.The explanationof the 4 dates are in the KB.

Do a desc dtree in a oracle tool and you will be able to see all the columns

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
I now read it more clearer.You are after who is the user who has modified the document after the createdby user has done it.For this if the event is audited you should use dauditnew table.Duaditnew has the same kuaf.id of your original query as performerid there.Change something in a node and filter that on dauditnew for that nodeid and you should be able to see the relation.Also I generally refrain from answering schema qns as it is protected by an NDA by OT.Hence the clues....

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
As AppNair highlights the DAUDITNEW table will provide the Audit information about specific changes to an Object - assuming that you had the correct configuration of Auditing on at the time.

The Database Schema can be got from your local OT Office once you have signed an NDA, Non Disclosure Agreement, raise a ticket with support to get a copy.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Nice tips! Now I got the idea here to join DTREE, KUAF, and DAUDITNEW tables. And I have succeeded to generate the query to get the users who have modified the documents.

Thanks appnair & greg :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top