473,387 Members | 1,592 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.

Unable to find the Parent table name if the child table is known also

i know the child table and i have the foreign key with me .
but the DB2 script has been written by someone else and i dont know how to get the prant table name.
is there any way to know the description of the Create table command that was used to create the child table.

in fact i want to know the way through which i can get to see the Create table command that was used to creatte the child table.
Apr 5 '07 #1
2 5331
kalexin
20
use sysibm.systables or syscat.tables
Apr 5 '07 #2
chandu031
78 Expert
use sysibm.systables or syscat.tables
Hi,


The foreign key info is stored in the view SYSCAT.REFERENCES ...

Jus run a query

SELECT REFTABNAME FROM SYSCAT.REFERENCES
WHERE TABNAME = '<CHILD_TABLE>' AND
TABSCHEMA = '<CHILD_TABLE_SCHEMA>'


Similarily you can get the columns of the Child table from SYSCAT.COLUMNS
Apr 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: William Gill | last post by:
I am trying to get & set the properties of a widget's parent widget. What I have works, but seems like a long way around the block. First I get the widget name using w.winfo_parent(), then i...
3
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...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
0
by: sandi | last post by:
I have Parent child table as decribe below: Parent Table name = TESTPARENT 1. counter bigint isIdentity=Yes Increment=1 Seed=1 2. customer nChar(10) Child Table name = TESTCHILD...
4
by: mikemiller.innova | last post by:
In Visual Studio 2005 SP1, I added a DataSet item into my project. I added 3 tables from SQL that have data and relationships. I added 2 lookup columns (lkp) to the DllVersions table in the...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
1
by: Richard | last post by:
Greetings. I am total newbie to Javascript so what is written below is probably a bunch of cobblers!! Any assistance in correcting my code much appreciated. I wish the popped up child to pass...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.