24 May,2014 by Jack Vamvas
Question: Given a view name , how can you get the definition of a View in DB2?
Answer: Query the SYSCAT.VIEWS and return the TEXT column. An alternative is to use the db2look utility
Syntax using SYSCAT.VIEWS
SELECT TEXT FROM SYSCAT.VIEWS WHERE VIEWNAME = 'myview' and viewschema = 'myschema'
Method 2 using db2look
Db2look –d mydatabase -t myView