Skip to content

Is there a SQL query to list user accounts (not employees) along with their enabled/disabled status, default company, and default site?

Answer

Yes — join ORACLE_ACCOUNT, USER_ALLOWED_SITE (filtered to the row marked as the user's default site type), and USER_PROFILE (filtered to the entry holding the default company value): select the username, a CASE expression translating the account status column into ENABLED/DISABLED, the default-site row's contract/site value, and the default-company profile entry's value, joining all three on the username. If employee (rather than user-account) information is actually what's needed instead, the EMP_EMPLOYED_TIME_ROW and COMPANY_PERSON_ALL views are a better starting point for that.

← Browse Security and access questions