Scenarios for Organization Objects

Determining All Departments

This statement identifies all departments in which 'JeJ' is entered.

SELECT [unit]
FROM [org]:[Unit] AS [unit]
JOIN [org]:[sysParent2Child]
JOIN [org]:[sysUser] AS [user]
WHERE [user].[sysName] = 'JeJ'

Identifying All Users

This statement identifies all users who are entered in multiple departments.

SELECT [u]
FROM [org]:[sysOrganisationUser] AS [u]
WHERE 1 < (
       SELECT COUNT(*)
       FROM [org]:[Unit]
       JOIN [org]:[sysParent2Child] AS [p2c]
       WHERE [p2c].[sysId2] = [u].[sysId]
)

Identifying all OrganizationUser Objects

This statement identifies all OrganisationUser objects.

SELECT [ou]
FROM [org]:[sysOrganisationUser] AS [ou]

Identifying All Organization Objects

This statement identifies all organization objects which are direct children of purchasing, so all employees of the Purchasing department.

SELECT [c]
FROM [org]:[sysObject] AS [p]
JOIN [org]:[sysParent2Child]
JOIN [org]:[sysObject] AS [c]
WHERE [p].[sysName] = 'Purchasing'

This statement identifies all organization objects.

SELECT [o]
FROM [org]:[sysObject] AS [o]

Identifying All Unit Objects

This statement identifies all unit objects.

SELECT [u]
FROM [org]:[Unit] AS [u]