Example documentationVIEWS Locate this document in the navigation structure

 

Use of the system table DOMAIN.VIEWS

Prerequisites

You can use the demo data for the SQL tutorial. Start the Database Studio as database administrator MONA with the password RED and log on to demo database DEMODB: Logging On to a Database.

Define view tables. Proceed as described in SQL Tutorial, View Tables.

Activities

You can use Database Studio to enter and execute SQL statements. More information: Working with SQL Statements: Overview

Note the General Instructions for formulating SQL statements.

You can use the system table VIEWS to determine the following database information, among other things:

  • All privileges of the view table CUSTOMER_ADDR

    SELECT privileges

    FROM DOMAIN.VIEWS

    WHERE schemaname = 'HOTEL'

    AND viewname = 'CUSTOMER_ADDR'

  • All view tables with their comments that the current database user can see without being the owner

    SELECT schemaname, viewname, comment

    FROM DOMAIN.VIEWS

    WHERE owner <> 'MONA'

More Information

Definition text of a view table: see VIEWDEFS

Existence of a view table: see TABLES

Synonym for a view table: see SYNONYMS

Tables and columns forming the basis for a view table: see VIEWCOLUMNS