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

Need a query to retrieve the structure of a DB2 table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
Reply with quote

Basic Catalog tables:

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

Link to IBM V8 manuals:

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

Link to V7 manuals:

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
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
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
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 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 RC query -Time column CA Products 3
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top