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

How to get table information in DB2?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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 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 Capturing Job Execution Information All Other Mainframe Topics 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