4

Can someone suggest me a DQL query to find the count of active users in a repository in documentum.

Below is the query I am using but it is not giving correct results, can someone suggest?

select count(user_name) from dm_user u , dm_group g  where any g.i_all_users_names = u.user_name and  u.user_state=0
Miki
  • 2,493
  • 2
  • 27
  • 39
ScriptLearner
  • 163
  • 3
  • 16

2 Answers2

6
SELECT count(user_name) FROM dm_user u, dm_group g  
WHERE ANY g.i_all_users_names = u.user_name 
AND u.user_state = 1

Property user_state values are:

  • 0 user can log in (active)
  • 1 user inactive
  • 2 user locked
  • 3 user locked and inactive
Miki
  • 2,493
  • 2
  • 27
  • 39
1
SELECT count(user_name) FROM dm_user WHERE user_state = 0 and r_is_group = false
Adrian W
  • 4,563
  • 11
  • 38
  • 52
  • Welcome to Stack Overflow! Thank you for this code snippet, which might provide some limited, immediate help. A [proper explanation would greatly improve its long-term value](//meta.stackexchange.com/q/114762/206345) by showing _why_ this is a good solution to the problem, and would make it more useful to future readers with other, similar questions. Please [edit] your answer to add some explanation, including the assumptions you've made. – Blue Oct 19 '18 at 23:26