IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can i see table definition in QMF


IBM Mainframe Forums -> DB2
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
vaibhavbleo

New User


Joined: 25 Sep 2007
Posts: 7
Location: pune

PostPosted: Fri Jul 11, 2008 4:39 pm
Reply with quote

How can i see table definition in qmf(need a query)?
Back to top
View user's profile Send private message
neeharika

New User


Joined: 23 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Fri Jul 11, 2008 4:46 pm
Reply with quote

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
View user's profile Send private message
vaibhavbleo

New User


Joined: 25 Sep 2007
Posts: 7
Location: pune

PostPosted: Fri Jul 11, 2008 4:55 pm
Reply with quote

I want to see its primary key and foreign key constraints?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Jul 11, 2008 4:56 pm
Reply with quote

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
View user's profile Send private message
vaibhavbleo

New User


Joined: 25 Sep 2007
Posts: 7
Location: pune

PostPosted: Fri Jul 11, 2008 4:59 pm
Reply with quote

Is that any way to see it or i need ask it to DBA?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jul 11, 2008 5:07 pm
Reply with quote

Quote:
Only characteristics of table, views , indexes etc are stored in catalog tables


sorry to disagree icon_biggrin.gif
but IIRC sysibm.syscolumns contains everything needed to reconstruct a table definition
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Jul 11, 2008 5:13 pm
Reply with quote

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
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Jul 11, 2008 5:27 pm
Reply with quote

Use SYSRELS and SYSFOREIGNKEYS to find wht you need ...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 11, 2008 5:44 pm
Reply with quote

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
View user's profile Send private message
vaibhavbleo

New User


Joined: 25 Sep 2007
Posts: 7
Location: pune

PostPosted: Fri Jul 11, 2008 5:51 pm
Reply with quote

Thanks all of you for quick reply SYSFOREIGNKEYS is working
Back to top
View user's profile Send private message
vaibhavbleo

New User


Joined: 25 Sep 2007
Posts: 7
Location: pune

PostPosted: Fri Jul 11, 2008 5:53 pm
Reply with quote

How to identify parent keys for tables?
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Fri Jul 11, 2008 5:55 pm
Reply with quote

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
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Jul 11, 2008 5:56 pm
Reply with quote

As Dick suggested look in the appendix of any guide ..chk for "Using catalog for database design "
Back to top
View user's profile Send private message
nabarundas

New User


Joined: 21 Jun 2007
Posts: 28
Location: pune

PostPosted: Mon Jul 14, 2008 11:51 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top