1.Get user
SELECT *
FROM dm_user
WHERE r_is_group = 0
2.Get Group
SELECT *
FROM dm_group
WHERE group_class = 'group'
3.Get File
SELECT *
FROM dm_document(
ALL)
WHERE
FOLDER('{0}')
SELECT *
FROM dm_document(
ALL)
WHERE
FOLDER(
ID('{0}'))
4.Get Version
SELECT r_object_id,r_version_label
FROM dm_document(
ALL)
WHERE i_chronicle_id = '{0}'
ORDER BY r_version_label
DESC ENABLE(
RETURN_TOP 3)
5.Get Regular Document
SELECT r_object_id
FROM dm_document
WHERE
FOLDER(
ID('{0}'))
AND (r_assembled_from_id = '0000000000000000'
OR r_assembled_from_id
IS
NULL)
AND (i_chronicle_id
NOT
IN (
SELECT i_chronicle_id
FROM dm_document(
ALL)
WHERE
FOLDER(
ID('{0}'))
AND (r_is_virtual_doc != 0 OR r_link_cnt != 0)))
6.Get Virtual Document
SELECT r_object_id
FROM dm_document
WHERE i_chronicle_id
IN (
SELECT i_chronicle_id
FROM dm_document(
ALL)
WHERE
FOLDER(
ID('{0}'))
AND (r_is_virtual_doc != 0
OR r_link_cnt != 0))
7.Get Snapshot
SELECT r_object_id
FROM dm_document
WHERE
FOLDER(
ID('{0}'))
AND r_is_virtual_doc =
FALSE
AND r_assembled_from_id != '0000000000000000'
AND r_assembled_from_id
IS
NOT
NULL
8.Get attribute of user types
SELECT dd.attr_name,df.parent_type
FROM dm_foreign_key df, dmi_dd_attr_info dd
WHERE (df.parent_type = 'dm_user'
OR df.parent_type = 'dm_group')
AND
ANY dd.foreign_keys = df.r_object_id
AND type_name = '{0}'