MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to know BASE table

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Wed Jul 13, 2005 5:55 am    Post subject: how to know BASE table Reply with quote

Hi

I have a view. how to know on which base tables this view is created.

thanks
nadh
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Jul 13, 2005 6:23 am    Post subject: Reply with quote

nadh,

For every view you create, DB2 stores descriptive information in several catalog tables. The following actions occur in the catalog after the execution of CREATE VIEW:


A row is inserted into SYSIBM.SYSTABLES.

A row is inserted into SYSIBM.SYSTABAUTH to record the owner's privileges on the view.

For each column of the view, a row is inserted into SYSIBM.SYSCOLUMNS.

One or more rows are inserted into the SYSIBM.SYSVIEWS table to record the text of the CREATE VIEW statement.

For each table or view on which the view is dependent, a row is inserted into SYSIBM.SYSVIEWDEP to record the dependency. You need to select the BNAME column from the table.

Check this link for SYSIBM.SYSVIEWDEP table explanation.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/D.80?DT=20010718164132

A row is inserted into SYSIBM.SYSVTREE, and possibly into SYSIBM.SYSVLTREE, to record the parse tree of the view (an internal representation of its logic).


Hope this helps...

Cheers

Kolus
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Wed Jul 13, 2005 7:53 am    Post subject: Reply with quote

thank you very much kolusu.

regards
nadh
Back to top
View user's profile Send private message Send e-mail
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Thu Jul 14, 2005 1:20 am    Post subject: Reply with quote

If DB2ADM installed in your system, then it's a easy thing.
type t before the view listed, show you all the table related.
Back to top
View user's profile Send private message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Fri Jul 15, 2005 2:25 am    Post subject: Reply with quote

Hi

As kolus said i have written the followin sql and got the result.

SELECT BNAME,BTYPE FROM SYSIBM.SYSVIEWDEP WHERE DNAME = 'VW00001A'

There is another way to find the same. In FADB2 OPTION 3.4 WILL GIVE THE BASE TABLE IF WE GIVE THE VIEW NAME DIRECTLY.

THANKS
NADH
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group