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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts unload data from table with lob columns farhad_evan DB2 1 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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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