1

I have a situation like this: I need to find out the i_chronicle_id of a document. If I try with r_object_id(i.e select i_chronicle_id from dm_document where r_object_id='some id', it will return me the i_chronicle_id. Then no problem. But if someone has modified the document(checked out and checked in) my above query doesn't work because the r_object_id has changed in that situation, which I do not know. Can anyone help me with dql in such a situation?

Note: The reason why I search for the i_chronicle_id is to get the latest r_object_id.

Timwi
  • 65,159
  • 33
  • 165
  • 230
Ananth
  • 10,330
  • 24
  • 82
  • 109
  • Hang on... To get the `i_chronicle_id` you need to know the `r_object_id`, but to get the `r_object_id` you need to search for the `i_chronicle_id` first? Circular requirement ahoy? – Timwi Sep 18 '10 at 09:00
  • I have the r_object_id. But that is not of the CURRENT version.Hence Iam unable to find it under dm_document table. Is there a way to get the r_object_id of the current version object from a r_object_id of previous version object ? – Ananth Sep 18 '10 at 11:10

1 Answers1

3

try doing something like the following

select r_object_id from dm_document 
where i_chronicle_id in (
    select i_chronicle_id from dm_document (ALL) where r_object_id = ID('?')
)

The (ALL) keyword after the type selects all versions

Michael Rutherfurd
  • 13,815
  • 5
  • 29
  • 40