Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can i see table definition in QMF

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How can i see table definition in QMF
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    Post subject: Reply to: table definition in qmf
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    Post subject:
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    Post subject:
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    Post subject: Is that any way to see it or i need to have a
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Fri Jul 11, 2008 5:07 pm    Post subject: Reply to: table definition in qmf
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    Post subject:
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Jul 11, 2008 5:44 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to see VIEW definition from BMC c... rohanthengal DB2 1 Thu May 04, 2017 1:50 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us