473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to display dependencies for a view (source tables)

For db2 UDB I need to get dependency information for views.

What I'm looking for is the tables that have the source information for
the view.
i.e. : if the following view was defined in my database:
create view my_view as
select parent_id, son_id
from parent A, son B
where A.parent_id = B.parent_id
Is there any way that starting from my_view I can get the information
that parent and son are the tables that are actually the source tables
for the data that make up the view?
Another *different* question is how can I get the code that generates
the view (the select query above). But please note that this will *not*

solve my problem, I am working in a programmatic environment so I can't

"parse" a bunch of SQL to find out which ones are the source tables.

What I need is a result set that contains the table names of 'parent'
and 'son' (referring to the example). Ideally, something like:
SQL> [magic query involving my_view];
TABLE
------
parent
son

What is the magic query?

Any help would be greatly appreciated. :)

S

Nov 12 '05 #1
3 12339
Seba wrote:
For db2 UDB I need to get dependency information for views.

What I'm looking for is the tables that have the source information for
the view.
i.e. : if the following view was defined in my database:

Take a look at SYSCAT.VIEWS for the view text.
Check out SYSCAT.VIEWDEP for immediate objects the view depends on.
To find all the objects recursively check out the DB2LK_DEP_OF()
function in SYSCAT.ROUTINES. That one looks up. You can use it as a
template to get one that looks down.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
Ian
Seba wrote:
For db2 UDB I need to get dependency information for views.

What I'm looking for is the tables that have the source information for
the view.
i.e. : if the following view was defined in my database:
create view my_view as
select parent_id, son_id
from parent A, son B
where A.parent_id = B.parent_id
Is there any way that starting from my_view I can get the information
that parent and son are the tables that are actually the source tables
for the data that make up the view?
Another *different* question is how can I get the code that generates
the view (the select query above). But please note that this will *not*

solve my problem, I am working in a programmatic environment so I can't

"parse" a bunch of SQL to find out which ones are the source tables.

What I need is a result set that contains the table names of 'parent'
and 'son' (referring to the example). Ideally, something like:
SQL> [magic query involving my_view];
TABLE
------
parent
son

What is the magic query?


See SYSCAT.TABDEP

select bschema, bname
from syscat.tabdep
where tabschema = ? and tabname = ?

Nov 12 '05 #3

Seba wrote:
For db2 UDB I need to get dependency information for views.

What I'm looking for is the tables that have the source information for the view.
i.e. : if the following view was defined in my database:
create view my_view as
select parent_id, son_id
from parent A, son B
where A.parent_id = B.parent_id
Is there any way that starting from my_view I can get the information
that parent and son are the tables that are actually the source tables for the data that make up the view?
Another *different* question is how can I get the code that generates
the view (the select query above). But please note that this will *not*
solve my problem, I am working in a programmatic environment so I can't
"parse" a bunch of SQL to find out which ones are the source tables.

What I need is a result set that contains the table names of 'parent'
and 'son' (referring to the example). Ideally, something like:
SQL> [magic query involving my_view];
TABLE
------
parent
son

What is the magic query?

Any help would be greatly appreciated. :)

S


if you're going to be spending a significant amount of time in
databases (DB2 or otherwise), i advise getting AQT (www.querytool.com).

if provides that specifically and a boat load of other info that
is more or less a pain to get manually.

btdb

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Taylor-Johnston | last post by:
This will give me the source of the current page. <a herf="javascript:document.location = 'view-source:'+document.location">testpage.htm</a> I want to display the source of another page, using...
5
by: Pete Wason | last post by:
Hiall! I have a demo viewer page for javascript stuff that has three buttons "DEMO" "HTML" and "JSCR", and an IFRAME called 'viewer'. Initially, the IFRAME gets loaded with the actual demo...
4
by: k | last post by:
A programming the internet class has been asked if it is possible to 'grey out' the View Source option in a browser menu. Multiple respondents think it is possible but not sure how to do it. I have...
8
by: Nancy | last post by:
Hi, Guys, I don't know why I can't view some webpages source code by click "View->Source" menu of Browser. These webpage source code can be viewed in same way by using other computers. My OS is...
6
by: shr | last post by:
Is there any way by which I can display the source of a html page using the 'view:source' command, in an iframe?? I tried using this viewer.location = "view-source:" + viewer.location.href; where...
29
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank...
24
by: Roman | last post by:
Hello to everybody, I have some question concerning blocking view source from main menu of IE or MF. I am able to block right click with <body oncontextmenu="return false"> but still missing from...
8
by: devain | last post by:
Question about positioning in view source. What I am trying to accomplish is this: 1. I have content that is revelant to the my site that is currently being displayed to the user at the bottom...
1
by: khadar siddi | last post by:
I have tested this in the following two browsers. 1.Internet Exolorer 2.Mozilla FireFox In Internet Explorer: ------------------------ When I right click and see the view source...the html...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.