DQL Select 返回多行可重复值
我使用的是 Documentum Developer Edition 6.6。我运行了以下 DQL: 从“dm_document”中选择“r_object_id”,“r_modify_date”,“r_version_label”,“i_position”,“object_name”,其中FOLDER(ID('0bde75d18000cfa4'))和“r_object_type”='dm_document' order by“r_modify_date”asc,“ i_position" desc
我期望:DQL 将为每个返回一行dm_documentum 对象。我记得 – 我之前对这个 DQL 的请求做到了 – 每个文档一个鱼子。但今天我看到:对于某些 dm_document 对象,仅返回一行;而对于其他 dm_document 对象,每个对象返回几行!如下所示:
09de75d18000d514 7/28/2011 3:41 PM 1.0,CURRENT -1,-2 Doc1 09de75d18000d515 7/28/2011 3:41 PM 1.0 -1 Doc2 ... 09de75d18000d515 7/28/2011 3:41 PM CURRENT -2 Doc2
换句话说 – 对于 09de75d18000d514,返回一行(以可重复的“r_version_label”和“i_position”作为数组);而对于另一个文档 09de75d18000d515,返回可重复属性作为单独的行。 这是为什么?对我来说,这看起来像是一个错误——因为文档 09de75d18000d514 和 09de75d18000d515 没有本质区别;它们只是普通的 dm_document 实例,仅此而已。
更重要的问题是:我能做什么?如果我从 DQL 中删除““i_position”desc”,我发现问题就会消失 - 然后每个 dm_object 将作为单行返回。但我需要这种““i_position”desc”排序,以使“r_version_label”根据“i_position”的相应值进行排序(“r_version_label”数组的每个项目对应于“i_position”数组中包含其“position”的项目数字”)。 也许我的假设——Documentum 应该根据“i_position”对“r_version_label”进行排序,因为我指定了““i_position”desc”——是错误的?如果是这样,现在我看到解决这个问题的唯一方法:
- 我使用没有““i_position”desc”的 DQL
- 我的软件(它使用 DFS)将对“r_version_label”项目本身进行排序 - 在 DQL 带来结果之后 - 使用“i_position”中的索引
也许一些更好的解决方案是 可用的?
I am using Documentum Developer Edition 6.6. I have run the following DQL:
select "r_object_id", "r_modify_date", "r_version_label","i_position" ,"object_name" from "dm_document" where FOLDER (ID('0bde75d18000cfa4')) and "r_object_type"='dm_document' order by "r_modify_date" asc, "i_position" desc
I expected: the DQL will return one row for each dm_documentum object. I remember – my earlier requests with this DQL did it – one roe for each document. But today I see: for some of the dm_document objects only one row returned; whereas for other dm_document objects several rows are returned per object! Like the following:
09de75d18000d514 7/28/2011 3:41 PM 1.0,CURRENT -1,-2 Doc1
09de75d18000d515 7/28/2011 3:41 PM 1.0 -1 Doc2
...
09de75d18000d515 7/28/2011 3:41 PM CURRENT -2 Doc2
In other words – for a the 09de75d18000d514 one row (with repeatable “r_version_label" and "i_position" as arrays) was returned; whereas for another document 09de75d18000d515 the repeatable properties were returned as separate rows.
Why is that? For me, this looks like a bug – because of the documents 09de75d18000d514 and 09de75d18000d515 have no essential differences; they are just usual dm_document instances, nothing more.
And the more important question is: what can I do? I see the problem disappears if I remove the “"i_position" desc” from the DQL – then each dm_object is returned as single row. But I needed this “"i_position" desc” sorting to have “r_version_label" sorted in accordance to corresponding values of the "i_position" (each item of “r_version_label" array corresponds to an item of the "i_position" array that contains its “position number”).
Maybe this my assumption – that Documentum should order the “r_version_label" accordingly to the "i_position" because of I specified “"i_position" desc” – was wrong? If so, now I see the only way to cope with this:
- I use the DQL without the “"i_position" desc”
- My software (it uses DFS) will sort the “r_version_label" items itself - after the DQL brought the results - using their indexes from "i_position"
Maybe some better solution is available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您想要获取具有 r_version_label 的行,其顺序与对象中的顺序(如果已获取)相同。
我知道您可以使用“order by r_object_id, i_position desc”。
由于您也想对 r_modify_date 进行排序,因此您可以尝试“order by r_modify_date asc, r_object_id, i_position desc”,或者只是在代码中进行日期排序。
I assume you want to get rows which have r_version_label in the same order than in the objects if they had been fetched.
I know that for that you can use 'order by r_object_id, i_position desc'.
Since you want ordering on r_modify_date as well, you could try 'order by r_modify_date asc, r_object_id, i_position desc' or just do the date sorting in your code.