473,811 Members | 2,190 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 12436
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
12591
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, unless it is saved on a server with http:// in front of it.
5
7214
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
2419
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
2897
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
1943
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 display the source.
29
9806
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
16096
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
1682
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 the content in the view source to actually load first on the page elow the body tag. Is there a way...
1
1987
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
9728
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10402
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9205
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5554
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.