MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 Table definition

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
ademy
Beginner


Joined: 24 Sep 2004
Posts: 2
Topics: 2

PostPosted: Fri Sep 24, 2004 6:30 pm    Post subject: DB2 Table definition Reply with quote

In oracle you can do describe <Table_Name> to check table definition. What is the equivalent in DB2 /
_________________
Thanks
Adem
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Sep 24, 2004 6:45 pm    Post subject: Reply with quote

Ademy,

The option 2(DCLGEN) on the Interactive DB2 panel will give you the table definition. Alternatively you can run the following JCL which will create the table definition in your pds.

Code:

//STEP0100 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
  DSN SYSTEM(XXXX)
  DCLGEN TABLE(TABLENAME) OWNER(OWNERNAME) ACTION(REP) -
  LIBRARY('PDS(TBLNAME)')
  END
//*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Sat Sep 25, 2004 4:13 am    Post subject: Reply with quote

Hi,
the db2 command to disply table structutre is :-

DESCRIBE TABLE <table name>.
OR
DESCRIBE INDEXES FOR TABLE <table name>.

describe do the following :
-> Displays columns of a table or a view
-> Displays indexes of a table or a view

hope this helps.........

Thanks & regrads
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Sat Sep 25, 2004 8:17 am    Post subject: Reply with quote

Pzmohanty,

Can you please enlighten me as to how you can run the DESCRIBE commands that you have shown in your post? Can I run them in Spufi or QMF?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Sun Sep 26, 2004 3:40 am    Post subject: Reply with quote

Optionally, you may code the language parameter in the job posted by Kolusu.
Code:

//STEP0100 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
  DSN SYSTEM(XXXX)
  DCLGEN TABLE(TABLENAME) OWNER(OWNERNAME) ACTION(REP) -
  LANGUAGE(PLI) -
  LIBRARY('PDS(TBLNAME)')
  END
//*


The default seems to be COBOL.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group