Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us