View previous topic :: View next topic
|
Author |
Message |
vaibhavbleo
New User
Joined: 25 Sep 2007 Posts: 7 Location: pune
|
|
|
|
How can i see table definition in qmf(need a query)? |
|
Back to top |
|
|
neeharika
New User
Joined: 23 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
I don't think we have any query to retrieve the definition of the table
.....Kindly reply if anyone know..
If you have the facility of DCLGEN you can generate the COBOL equivalent declarations for the columns in the table...
There itself you can see the declaration of the table even...
Thanks,
Neeharika. |
|
Back to top |
|
|
vaibhavbleo
New User
Joined: 25 Sep 2007 Posts: 7 Location: pune
|
|
|
|
I want to see its primary key and foreign key constraints? |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Only characteristics of table, views , indexes etc are stored in catalog tables ... and definitions are available only for triggers and constraints in catalog ... |
|
Back to top |
|
|
vaibhavbleo
New User
Joined: 25 Sep 2007 Posts: 7 Location: pune
|
|
|
|
Is that any way to see it or i need ask it to DBA? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
Only characteristics of table, views , indexes etc are stored in catalog tables |
sorry to disagree
but IIRC sysibm.syscolumns contains everything needed to reconstruct a table definition |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Enrico,
what i meant was DB2 does not store definition sqls for any table in any catalog tables ... ofcourse characteristics of the table are stored and the column definitions are available in syscolumns table ...[/b] |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
Use SYSRELS and SYSFOREIGNKEYS to find wht you need ... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
look in the appendex of any sql programmers guide.
actually there are 2, 1 explains the layout of each and what is contained
the other appendex gives examples of SQL for each. |
|
Back to top |
|
|
vaibhavbleo
New User
Joined: 25 Sep 2007 Posts: 7 Location: pune
|
|
|
|
Thanks all of you for quick reply SYSFOREIGNKEYS is working |
|
Back to top |
|
|
vaibhavbleo
New User
Joined: 25 Sep 2007 Posts: 7 Location: pune
|
|
|
|
How to identify parent keys for tables? |
|
Back to top |
|
|
vini_srcna
Active User
Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
Try SYSIBM.SYSFOREIGNKEYS & SYSKEYS. SYSRELS should also contain some information.
Is there no tool in your shop to see these details.?. Browsing catalog tables and finding info is really hectic.!! |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
As Dick suggested look in the appendix of any guide ..chk for "Using catalog for database design " |
|
Back to top |
|
|
nabarundas
New User
Joined: 21 Jun 2007 Posts: 28 Location: pune
|
|
|
|
Hi ,
In our shop we have Db2 admin tool. I don't know if your shop have the same or whether you have access the use the utility or not. Here is the way how I used to find the keys or structure of the tables(without using SYSIBM tables) :
Db2 admin tool---> db2 system catalog(option 1)--> Then there will be object list. select the database option by pressing D
Then find the appropriate database and in front of it press T(show tables). Then find your appropriate table and in front of the table
give line commands like PK(primary key), FK (foreign key),DDL (show the table DDL command) and many more options are there.
You can ask your admin guys about the availability of the tool.
Regards,
Nabarun |
|
Back to top |
|
|
|