Entering content frame

This graphic is explained in the accompanying text TABLEPRIVILEGES Locate the document in the library structure

Prerequisites

You have generated the Structure linkdemo data for the SQL Tutorial.

Log on to the demo database instance DEMODB as user MONA.

Define privileges. Proceed as described in SQL Tutorial, Structure linkDatabase Users and Their Privileges.

Examples

You can use the system table TABLEPRIVILEGES to 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 schemaname, tablename, privilege
  FROM DOMAIN.TABLEPRIVILEGES
    WHERE grantee = 'MONA'

     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 schemaname, owner, tablename
  FROM DOMAIN.TABLEPRIVILEGES
    WHERE grantee = 'MONA'
      AND privilege LIKE '%SEL%'
      AND is_grantable = 'YES'

     All privileges that the current user has granted to the user DAVID

SELECT schemaname, tablename, privilege
  FROM DOMAIN.TABLEPRIVILEGES
    WHERE grantor = 'MONA'
      AND grantee = 'DAVID'

Note

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

 

Leaving content frame