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
 

 

How to get table information in DB2?

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

New User


Joined: 04 Oct 2006
Posts: 10
Location: Pune

PostPosted: Fri Feb 02, 2007 2:56 pm    Post subject: Re: How to get table information in DB2?
Reply with quote

How to get infomation about each column of table in DB2? It should give column name, constraint on it, triggers if defined like we give while creating a table as shown below

CREATE TABLE EMPLOYEE
(EMPNO INTEGER GENERATED ALWAYS AS IDENTITY,
NAME CHAR(30),
SALARY DECIMAL(5,2),
DEPTNO SMALLINT);
Back to top
View user's profile Send private message

mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Feb 02, 2007 3:01 pm    Post subject: Re: How to get table information in DB2?
Reply with quote

Hi amitkoshti,

DCLGEN will give all the information about column names, constraints as u define at the time of table creation.

If wrong please correct me.
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Fri Feb 02, 2007 5:16 pm    Post subject: Re: Re: How to get table information in DB2
Reply with quote

Hi,

You are true, DCLGEN gives the solution, But for query

Code:

SELECT
            NAME,  TBCREATOR,  COLTYPE,  LENGTH,  NULLS
            FROM SYSIBM.SYSCOLUMNS
            WHERE TBNAME = 'table';
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 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 how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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