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
 

 

Need a query to retrieve the structure of a DB2 table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
prabhucs01
Warnings : 1

New User


Joined: 07 Mar 2005
Posts: 43

PostPosted: Wed Apr 27, 2005 4:05 pm    Post subject: Need a query to retrieve the structure of a DB2 table
Reply with quote

what is the query that could be used to get the structure of DB2 table.
Back to top
View user's profile Send private message

priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Thu Apr 28, 2005 7:46 am    Post subject:
Reply with quote

Use SPUFI - DCLGEN or Try EXPLAIN Statement.
Back to top
View user's profile Send private message
T-REXDB2

New User


Joined: 28 Apr 2005
Posts: 11
Location: USA

PostPosted: Thu Apr 28, 2005 9:32 am    Post subject:
Reply with quote

Basic Catalog tables:

SYSIBM.SYSDATABASE, SYSIBM.SYSTABLESPACE,SYSIBM.SYSTABLES, SYSIBM.SYSCOLUMNS, SYSIBM.SYSINDEXES,SYSIBM.SYSKEYS.

Link to IBM V8 manuals:

http://www-306.ibm.com/software/data/db2/zos/v8books.html

Link to V7 manuals:

http://www-306.ibm.com/software/data/db2/zos/v7books.html

You figure it out - it is not too difficult and you should be willing to work it out yourself. Don't wait around to be spoon fed! If you want that, go work on a Microsoft system - they have "wizards"!

T-REXDB2er
Back to top
View user's profile Send private message
T-REXDB2

New User


Joined: 28 Apr 2005
Posts: 11
Location: USA

PostPosted: Fri Apr 29, 2005 4:18 am    Post subject: figure it out....
Reply with quote

Basic SQL SELECT structure:

SELECT *
FROM TABLENAME1 A, TABLENAME2 B, TABLENAME3 C
WHERE
[ PREDICATE LIST GOES HERE ]
ORDER BY [SORT ORDER COLUMN LIST GOES HERE]

That is the basic SQL structure.
Back to top
View user's profile Send private message
shymalasridevi

New User


Joined: 03 May 2005
Posts: 16

PostPosted: Tue May 03, 2005 2:52 pm    Post subject: hai,
Reply with quote

to retreive the structure we have aquery

DESC TABLE TABLENAME
OR
DESC TABLENAME
SO THAT IT WILL DISPLAY THE STRUCTURE
Back to top
View user's profile Send private message
gokuldass

New User


Joined: 18 Mar 2005
Posts: 48
Location: india

PostPosted: Tue May 03, 2005 11:52 pm    Post subject: query to see the structure of a table
Reply with quote

hai prabhucs01..
i think this query will help u..

select * from sysibm.syscolumns where tbcreator='yourid' and tbname='tbname';

i am using the same query.. try this and reply me..
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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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