1

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?

KellyLynch
  • 241
  • 2
  • 9
  • 30

1 Answers1

2

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.

David Pierre
  • 9,459
  • 4
  • 40
  • 32