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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Document Count for Specific Folder

Status
Not open for further replies.

ujjval090683

Programmer
Nov 1, 2011
31
IN
Hi,
I am using below Query to find out document count for specific Folder using its ID. But those Queries returns different result, can you please tell me why?

1) Select count(*) from dtree where ownerid = -2000 and modifydate > TO_DATE('29/12/2011','dd/mm/yyyy')

2) select count(*) from webnodes
where subtype = '144' and
modifydate > TO_DATE('29/12/2011','dd/mm/yyyy')) and
dataid in (select dataid from dtree connect by prior dataid=parentid start with parentid='2000')

3)select count(*) as DOCCOUNT_withoutvers from webnodes where subtype='144' and dataid in(select dataid from dtreeAncestors where AncestorID='2000') and modifydate > TO_DATE('29/12/2011','dd/mm/yyyy'))

Thanks in advance.
 
you are querying different things which is probably why the results are not what you are expecting, check out the design of the WEBNODES view.

If you just want direct children, then you can use the CHILDCOUNT column in DTREE for the row of the container item, or
Code:
SELECT COUNT(*) FROM dtree WHERE parentid=<container id>
.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top