You are on page 1of 8

Useful DQL:

select documents with pdf renditions :


select * from dm_document where exists(select * from dmr_content where any
parent_id=dm_document.r_object_id and full_format=pdf)
DQL for finding all checked out documents in a docbase
select * from dm_document where (r_lock_owner is not nullstring or r_lock_owner or
r_lock_owner )
DQL to list the users who has access to particular folder path
SELECT i_all_users_names FROM dm_group
WHERE group_name IN (SELECT r_accessor_name FROM dm_acl
WHERE object_name IN (SELECT acl_name FROM dm_folder
WHERE ANY r_folder_path = /folderpath))
ORDER BY i_all_users_names
select component from workitem
select r_component_id from dmi_package p where exists (select r_object_id
from dmi_workitem w where w.r_object_id = and w.r_workflow_id = p.r_workflow_id and
w.r_act_seq_no = p.r_act_seq_no)
find workflow given document
select * from dm_workflow where r_object_id in (select r_workflow_id from
dmi_package where any r_component_id in (select r_object_id from
dm_sysobject (all) where i_chronicle_id in (select i_chronicle_id from dm_sysobject
where r_object_id=))) and r_runtime_state=1
Return only inherited attributes
SELECT attr_name FROM dmi_dd_attr_info WHERE type_name = my_custom_type
AND attr_name NOT IN
(SELECT attr_name FROM dmi_dd_attr_info WHERE type_name = dm_document)
Label Text of the either System Type or Custom Type

select label_text from dm_nls_dd_info where parent_id in


(select r_object_id from dm_aggr_domain where type_name = field_type)

DQL to Get all Files under a Particular Cabinet


select r_object_id, object_name from dm_document(all) where folder(/Cabinet name,
descend);
DQL to find whether a document is a part of virtual document
SELECT object_name,r_object_id FROM dm_sysobject
WHERE r_object_id IN
(SELECT parent_id FROM dmr_containment
WHERE component_id = (SELECT i_chronicle_id FROM dm_sysobject WHERE
r_object_id = ))
Repeating attributes
select r_folder_path from dm_folder where object_name=myFolder and any
r_folder_path =/Cabinet Name/test;
Clear INBOX
delete dmi_queue_item objects where delete_flag=0
Please refer to all the workflow related DQL's below : I hope this will help you.

// Query to list all running workflows


select r_object_id, object_name, supervisor_name , r_start_date, r_performers,
r_perf_act_name from dm_workflow where r_runtime_state = 1 and process_id =
(select r_object_id from dm_process where object_name = 'WF Approve')

// Query to find all performers in the workflow


select r_object_id, group_name, users_names from dm_group where group_name in (
select r_performers from dm_workflow where r_runtime_state = 1 and process_id =
(select r_object_id from dm_process where object_name = 'WF Approve') )

// Query to identify the document associated to the workflow


select distinct r_component_id, r_workflow_id from dmi_package p where
p.r_workflow_id in(select r_object_id from dm_workflow where r_runtime_state = 1 and
process_id = (select r_object_id from dm_process where object_name = 'WF Approve'))

// Query to identify paused workflows


select w.r_object_id, object_name from dm_workflow w, dmi_workitem wi where
w.r_object_id=wi.r_workflow_id and wi.r_runtime_state=5 and process_id = (select
r_object_id from dm_process where object_name = 'WF Approve')

// Query to identify workflows whose Workflow Tasks are Paused:


select r_object_id, object_name, supervisor_name, r_start_date, r_act_name from
dm_workflow where process_id = (select r_object_id from dm_process where
object_name = 'WF Approve') and any r_act_name not in ('Approve','Review')

// Query to find out if any workflow is attached with a document:select distinct r_workflow_id from dmi_package p,dm_workflow w where
(p.r_workflow_id = w.r_object_id and any r_component_id = '<r_object_id of
document>') and (r_runtime_state = 1 or r_runtime_state= 3)

select * from dmi_queue_item where router_id='<Workflow ID>'

Groups:
DQL To retrieve group to which user belongs
Select group_name from dm_group where any users_names in (select user_name from
dm_user where user_os_name = username)
Select group_name from dm_group where any users_names in (ashraf) DQL To get all
the groups and count of all the active members in those groups

Select gr2.i_supergroups_names, count (gr1.users_names) from dm_group_r gr1,


dm_group_r gr2 where gr1.r_object_id = gr2.r_object_id and gr2.i_supergroups_names
is not null group by gr2.i_supergroups_names DQL To get the name of all groups and
name of all active users in those groups
select gr2.i_supergroups_names, gr1.users_names from dm_group_r gr1, dm_group_r
gr2 where gr1.r_object_id = gr2.r_object_id and gr2.i_supergroups_names is not null
and gr1.users_names in(select user_name from dm_user where user_state=0) order by
gr2.i_supergroups_names
DQL To get list of users and groups they belong to
SELECT DISTINCT u.user_name,u.user_os_name, g.group_name FROM dm_user u,
dm_group g WHERE ANY g.i_all_users_names = u.user_name and r_is_group = 0
order by u.user_name DQL To get the group names for particular user
SELECT DISTINCT u.user_name,u.user_os_name, g.group_name FROM dm_user u,
dm_group g WHERE ANY g.i_all_users_names = u.user_name and r_is_group = 0 and
u.user_name =ashraf order by u.user_name
DQL To get all active users in a particular group

Groups DQLs | Just Documentum


ALTER GROUP group_name ADD members
ALTER GROUP group_name ADD (select user_name from dm_user where user_name
= ashraf)
Ex 1:
ALTER GROUP enterprise ADD (select user_name from dm_user where user_name =
ashraf)
Ex 2:
To add 2 users namely Romeo and Juliet to a group
ALTER GROUP engineering ADD Romeo,Juliet
Ex 3:
To set/define an email address for a particular group

ALTER GROUP enterprise SET ADDRESS email@email.com DQL To remove user


from group
ALTER GROUP group_name DROP members

ALTER GROUP group_name DROP (select user_name from dm_user where


user_os_name = ashraf)
Ex:
Note: Before removing any user from any group make sure that which group the user
belongs to by using the following select query
Select group_name from dm_group where any users_names in (ashraf)
DQL To assign a user to many groups without changing users default group
UPDATE dm_group OBJECTS APPEND users_names = SR, ashraf WHERE
group_name IN (fe_general, enterprise); DQL To set a default group for a user
UPDATE dm_user objects set user_group_name =engineering where user_name=SR,
ashraf

SELECT DISTINCT u.user_name,u.user_os_name,u.user_state, g.group_name FROM


dm_user u, dm_group g WHERE ANY g.users_names = u.user_name and r_is_group =
0 and u.user_state=0 and g.group_name=admingroup order by u.user_name DQL To
add a user to a group
ALTER GROUP enterprise DROP (select user_name from dm_user where
user_os_name = ashraf)
Note: If you modifying the groups repeatedly using this query, the most recently updated
group using this query will be the default group for the user and the previously added
groups also will be there in the groups that user belongs to.

Groups DQLs | Just Documentum


For ex,

UPDATE dm_user objects set user_group_name =enterprise where user_name=SR,


ashraf
After the execution of this query, default group for ashraf will be enterprise and we
check for the group that the user belongs, to all these groups for ex enterprise and also
docu groups will be there
DQL To retrieve groups access info on the folders
SELECT r_accessor_name, r_accessor_permit FROM dm_acl WHERE object_name IN
(SELECT acl_name FROM dm_folder WHERE ANY r_folder_path = /SASBU/NON
BLOCK SPECIFIC)
DQL To remove a group from the repository
DROP GROUP group_name
Ex: Drop Group finance_orders
DQL To get subgroups
Select group_name from dm_group where any i_supergroups_names=enterprise
Note: Using this query we can find the list of subgroups that the group enterprise (super
group) has.
DQL To deactivate user
UPDATE dm_user OBJECTS SET user_state = 1 WHERE user_name = username.
Ex:
UPDATE dm_user OBJECTS SET user_state = 1 WHERE user_name = SR, ashraf
DQL To grant extended priviledges Grant Config Audit to User User_name
DQL to provide/assign/give groups access on the folders
SELECT r_accessor_name, r_accessor_permit FROM dm_acl WHERE object_name IN
(SELECT acl_name FROM dm_folder WHERE ANY r_folder_path = /FolderPath.)
Ex:
SELECT r_accessor_name, r_accessor_permit FROM dm_acl WHERE object_name IN
(SELECT acl_name FROM dm_folder WHERE ANY r_folder_path = /Equity/Europe)
DQL To get subgroups

select group_name from dm_group where any i_supergroups_names =


YourGroupName
Ex:
Groups DQLs | Just Documentum
select group_name from dm_group where any i_supergroups_names =
Materials_department

Structured Data type:

select *from dmc_wfsd_type_info


To get List Of Task Space Applications:
select *from dmc_taskspace_app
To find Repeating attributes OF an Object Type:
select r.attr_name,r.attr_type,r.attr_length from dm_type_s s, dm_type_r r
where s.r_object_id = r.r_object_id and s.name = <object type you want to check>' and
r.attr_repeating = 1
DQL query for folder name greater than 128 chars :
select r_object_id, object_name from dm_folder where object_name in (select
object_name from dm_folder where object_name not in
(select substr(object_name, 1, 20) from dm_folder));
Value Assistance Query:
Select query_attribute, query_string from dm_value_query
ALTER TYPE ff3_basic MODIFY (ff3_schlagworte(VALUE ASSISTANCE IS QRY
'SELECT DISTINCT ff3_schlagworte, i_position FROM ff3_va WHERE ANY
ff3_schlagworte IS NOT NULL ORDER BY 2 DESC'))
DQL to alter object type :
ALTER type <type_name> DROP <attr_name> PUBLISHES;
ALTER TYPE <type_name> ADD (attribute_name char(8)) PUBLISH;

ALTER TYPE <type_name> MODIFY (attribute_name (VALUE ASSISTANCE IS LIST


('Yes',''))) PUBLISH;

You might also like