我正在使用 Documentum 开发人员版 6.6。我需要(使用 DFS)执行以下 DQL 表达式
从“dm_document”中选择“r_version_label”、“i_chronicle_id”、“i_position”、“r_modify_date”、“subject”、“title”、“r_object_type”、“object_name”、“r_object_id”,其中FOLDER(ID('0cde75d180000107'))和 "r_object_type"='dm_document' 按 "r_modify_date" asc, "i_position" desc 排序
但我只需要 Select 返回的前 N 个对象。我重复一遍:N 个对象,而不是行(这很重要,因为结果属性中的 r_version_label 是一个可重复的字段)。
我尝试使用以下 DQL 执行此操作: select "r_version_label","i_chronicle_id", "i_position", "r_modify_date" , "subject","title","r_object_type","object_name","r_object_id" from "dm_document"其中 FOLDER (ID('0cde75d180000107')) 和 "r_object_type"='dm_document' 按 "r_modify_date" asc、"i_position" desc 排序 ENABLE (OPTIMIZE_TOP , RETURN_TOP)
但我看到:返回的是行,而不是对象。这是因为我的 Documentum Server 具有默认参数 return_top_results_row_based (=true)。更改 server.ini 中的参数对我来说是不可接受的——我必须编写一个应用程序,无论 return_top_results_row_based 是什么,它都将以相同的方式工作。
我试过 RETURN_RANGE、SQL_DEF_RESULT_SET 和 FETCH_ALL_RESULTS 而不是 RETURN_TOP——但它们的 N 也是行。
所以,现在我看到了唯一的方法。我将使用以下 DQL: select "r_version_label","i_chronicle_id", "i_position", "r_modify_date" , "subject","title","r_object_type","object_name","r_object_id" from "dm_document" where FOLDER ( ID('0cde75d180000107')) 和 "r_object_type"='dm_document' order by "r_modify_date" asc, "i_position" desc ENABLE (OPTIMIZE_TOP , RETURN_TOP)
在处理结果时,我的应用程序将仅使用返回的前 N 个对象。希望“OPTIMIZE_TOP”能够最大限度地减少读取我不会使用的对象的时间。我的 DBMS 是 MSSQL,DQL 参考说“OPTIMIZE_TOP”确实对 MSSQL 有效。
也许有人可以提出更好的解决方案?