Using the TABLEPRIVILEGES system table, you can determine the following database information, among other things:
·
All
tables for which the current user has been granted a privilege. Own
tables are not output.
SELECT owner,
tablename, privileges
FROM DOMAIN.TABLEPRIVILEGES
WHERE grantee = user
·
All
tables for which the current user has been granted the SELECT privilege and is
allowed to pass this on. Own tables are not output.
SELECT owner,
tablename
FROM DOMAIN.TABLEPRIVILEGES
WHERE grantee = user
AND privileges LIKE '*SEL*'
AND is_grantable = 'YES'
·
All
privileges that the current user has passed on to user USER2
SELECT owner,
tablename, privileges
FROM DOMAIN.TABLEPRIVILEGES
WHERE grantor = user
AND grantee = 'USER2'
All tables: see TABLES
Existence of a table: see TABLES
Table definition: see COLUMNS
Synonym for a table: see SYNONYMS
Table privilege: see TABLES
Table in a view definition: see VIEWCOLUMNS