Query below finds all views in a database with their script.
select viewschema as schema_name, viewname as view_name, text as definition from syscat.views where viewschema not like 'SYS%' order by schema_name, view_name
- schema_name - schema name of the view
- view_name - name of the view
- definition - definition (script) of the view
- One row represents a view
- Scope of rows: all found views
- Ordered by schema name, view name