List views in IBM Db2 database with their scripts

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

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.