Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
prabhucs01

New User


Joined: 07 Mar 2005
Posts: 40

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
References
priya

Moderator


Joined: 24 Jul 2003
Posts: 624
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: 45
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1