## VIEWDEFS

### Prerequisites

You have generated the demo data for the SQL Tutorial.

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

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

### Examples

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

● SQL statement text used in the view table definition

SELECT definition
FROM DOMAIN.VIEWDEFS
WHERE schemaname = 'HOTEL'
AND viewname = 'CUSTOMER_ADDR'

● Length of the view table definition

SELECT len
FROM DOMAIN.VIEWDEFS
WHERE schemaname = 'HOTEL'
AND viewname = 'CUSTOMER_ADDR'

Only the owner of a view table can select the definition. No output is provided for any other users.

All view tables: see VIEWS

Existence of a view table: see TABLES

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