473,554 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12381
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
12565
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 something like this but it doesn't work: <a herf="javascript:document.location = 'view-source:'+'testpage.htm'>testpage.htm</a> ?? Won't work,...
5
7200
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 page, ie., viewer.location = dName + '.html'; where dName is the filename of the demo without extension.
4
2408
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 seen the 'Print' option greyed out at some sites... Can you provide or recommend a specific way of achieving this?
8
2879
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 Win Xp and Browser is IE6.0. I don't use any fire wall. Appreciate any hint. Nancy
6
1930
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 viewer is an iframe. but it opens the source in a notepad. Instead of the source getting displayed in the notepad, I would like the iframe to...
29
9751
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 you.
24
16070
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 main View->Source Code. Any hints ? Regards, Roman
8
1666
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 of the page using css and html. 2. When I view source this content and div tags are at the bottom of the page. What I am wanting to do is have...
1
1973
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 code to display the table is presnt..But still the table is not getting displayed. In Mozilla FireFox:
0
7612
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7536
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7576
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3583
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3564
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1147
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.