Suppose I have the following scheam (parent->child) :
A->B->C->D, E->F
Can someone help me with the sql query in db2 which will give me the
complete chain once i give it the parent table. eg. for input A, i
should get B, C, D and for input E it should give me F.
Thanks 3 2085 am***********@gmail.com wrote:
Suppose I have the following scheam (parent->child) :
A->B->C->D, E->F
Can someone help me with the sql query in db2 which will give me the
complete chain once i give it the parent table. eg. for input A, i
should get B, C, D and for input E it should give me F.
You need to write a recursive query over SYSCAT.REFERENCES.
Enjoy
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
On May 30, 5:32 pm, Serge Rielau <srie...@ca.ibm.comwrote:
amitabh.me...@gmail.com wrote:
Suppose I have the following scheam (parent->child) :
A->B->C->D, E->F
Can someone help me with the sql query in db2 which will give me the
complete chain once i give it the parent table. eg. for input A, i
should get B, C, D and for input E it should give me F.
You need to write a recursive query over SYSCAT.REFERENCES.
Enjoy
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Can someone help me formulate this query? am***********@gmail.com wrote:
On May 30, 5:32 pm, Serge Rielau <srie...@ca.ibm.comwrote:
>amitabh.me...@gmail.com wrote:
>>Suppose I have the following scheam (parent->child) : A->B->C->D, E->F Can someone help me with the sql query in db2 which will give me the complete chain once i give it the parent table. eg. for input A, i should get B, C, D and for input E it should give me F.
You need to write a recursive query over SYSCAT.REFERENCES.
Can someone help me formulate this query?
Download my "SQL on Fire" talk from here: http://www.iiug.org/waiug/present/Fo...Forum2006.html
It explains recursion and has an example.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: maricel |
last post by:
Is there a way to list (using db2 command or catalogs) to list hierarchy of
table parent & child relationship:
1) A list that shows which table should be deleted first,second,third...
2) A list...
|
by: Ilan Sebba |
last post by:
When it comes to adding records in related tables, Access is really smart.
But when I try to do the same using ADO, I am really stupid.
Say I have two parent tables (eg Course, Student) and one...
|
by: Bartje |
last post by:
Hey,
I am wondering what the best solution will be to program the following
problem in access, the dutch 97 edition.
I am developing a database for a day care centre (for my girlfriend).
This...
|
by: Neo Geshel |
last post by:
Greetings.
I have a serious problem. I have multiple sets of tables, several of
which are chained more than two tables deep. That is, I have a parent, a
child, and a great-grandchild table.
...
|
by: PAUL |
last post by:
Hello,
I have 2 tables with a relationship set up in the dataset with vb
..net. I add a new record to the parent table then edit an existing child
record to have the new parent ID. However when I...
| |
by: Dave |
last post by:
Hi all,
My question is: How do you obtain a complete list of all the users
that are registered on the local machine? I've been trying for hours
now and can't find anything that will help on...
|
by: sparks |
last post by:
I have a main table with teacher names and students
I can put this in a subform and filter by teacher name so I have
a list of her students in a sub form.
the problem I have is this is created in...
|
by: Rick |
last post by:
VS 2005
I' m setting up a parent/child datagridviews in a form.
I am doing a lot of this by hand coding in order to get the feel of things.
I want a change in the parent table to trigger a...
|
by: shapper |
last post by:
Hello,
I have the following list:
<ul id="parent" class="parent">
<li>
<img...
</li>
<ul id="child" class="child">
<li>Message 1</li>
|
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,...
|
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...
| |
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,...
|
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: 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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |