我正在处理一个FileNet项目,在这个项目中,我需要在一个名为on的文件夹中显示文档的计数。我可以通过can轻松地做到这一点,但我需要知道这些信息存储在FileNet DB中的位置。
我可以从一个名为DocVersion
的表中获取文档计数,文件夹信息存储在Container
表中。我需要的是这样一个查询:
SELECT COUNT(*) FROM DOCVERSION D, CONTAINER C WHERE --container name is 'Others'
任何帮助都将不胜感激。
发布于 2015-01-27 10:19:18
我还没有在应用程序中尝试这些代码,但是,它就像..
SELECT count (*) as Row_Count
FROM Container c, DocVersion d
WHERE c.object_id = d.object_class_id
AND c.name = 'Others'
希望这能对你的想法有所帮助。
发布于 2015-02-27 09:27:46
你是正确的。文档放在DocVersion中,文件夹放在容器表中。但是,放置在关系表中的文档和文件夹之间的链接。
如果您使用FileNet API,可以尝试使用下一个FN查询。
Select d.Id from Document d
where d.This INFOLDER '/bla/bla/bla'
或者INSUBFOLDER
操作符。在接下来的步骤中,您将需要计算结果集。
如果要直接从数据库获取信息,可以尝试使用“下一个查询”。
select count(r.Object_Id) from DocVersion d, Container c, Relationship r
where r.Head_Id = c.Object_Id
and d.Object_Id = r.Tail_Id --// you can exclude this if in the Folder filed only documents and not custom objects.
and c.Object_Id = {folder-id} --// or use c.Name = 'Other' - you can't use PathName field in DB query.
发布于 2017-01-04 19:02:28
谢谢你的询问,我已经试过了。您的查询中有一个问题。您在错误的方向使用了head_id和tail_id。正确的查询应该如下所示。
select count(r.Object_Id)
from DocVersion d, Container c, Relationship r
where r.Tail_Id = c.Object_Id and d.Object_Id = r.Head_Id --// you can exclude this if in the Folder filed only documents and not custom objects.
and c.Object_Id = {folder-id} --// or use c.Name = 'Other' - you can't use PathName field in DB query.
https://stackoverflow.com/questions/27752006
复制相似问题