DB2 How To get View definition

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


Read More

Create a DDL on an existing DB2 table

Deciding to reorg DB2 tables with overflow value

Commands to check for read only Linux file system

SQL Parser

Compare DDL of 2 databases in DB2

Linux top greater than 100 percent - CPU

Author: Jack Vamvas(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on DB2 How To get View definition

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright