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
 
query to fire in order to get the schema of a table.

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

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Thu Apr 20, 2006 4:04 pm    Post subject: query to fire in order to get the schema of a table.
Reply with quote

Hi all,

Can U tell me what query shud I fire in order to get the schema of Table???

I have the table name and need to know the datatypes and fields of that and keys if any exixt?

thanks
kiran
Back to top
View user's profile Send private message

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Apr 20, 2006 4:14 pm    Post subject: DB2 Query
Reply with quote

Hi kiran,

Try with SYSIBM.SYSTABLES or SYSIBM.SYSCOLUMNS. Hope u can get the field description there.
Back to top
View user's profile Send private message
BAJJI

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Thu Apr 20, 2006 4:17 pm    Post subject: Re: query to fire in order to get the schema of a table.
Reply with quote

hi kamarutheen,

can u pls write down the query.

thanks
kiran.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Fri Apr 21, 2006 7:29 pm    Post subject: DB2 Query
Reply with quote

Hi Kiran,


Use this query:

Quote:
Note: Use this query in QMF environment only.


Code:
 SELECT * FROM SYSIBM.SYSTABLES;
 SELECT * FROM SYSIBM.SYSCOLUMNS;
Back to top
View user's profile Send private message
BAJJI

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Fri Apr 21, 2006 7:45 pm    Post subject: Re: query to fire in order to get the schema of a table.
Reply with quote

hi khamarutheen,

I wanted to know what query shud I write in order to get the schema of a given table with table name EMPTABLE.

I need to know the datatypes and fields of that and keys if any exist for this one.

can you please write down the query.

thanks,
Kiran
Back to top
View user's profile Send private message
BAJJI

New User


Joined: 15 Jul 2005
Posts: 47

PostPosted: Tue Apr 25, 2006 7:37 pm    Post subject: Re: query to fire in order to get the schema of a table.
Reply with quote

Hi,

I found out and here comes the answer...

SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME LIKE 'EMPTABLE'

In this, all the column names are displayed Row-wise

Regarding keys, we can get the info from the column named NULLS

thanks,
Kiran.
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