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 fetch only 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
deepak_nag
Warnings : 1

New User


Joined: 16 Jun 2006
Posts: 4

PostPosted: Fri Jun 16, 2006 12:48 pm    Post subject: How to fetch only the structure of a DB2 table
Reply with quote

How can i fetch only the structure of a DB2 table using query ?

WARNING: TITLE EDITED
Back to top
View user's profile Send private message

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Fri Jun 16, 2006 7:23 pm    Post subject: DB2 Query
Reply with quote

Deepak,
You can use builtin tables such as SYSIBM.SYSCOLUMNS, SYSIBM.SYSFIELDS, place the table name in where caluse and check it.

Code:
Eg: SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = 'EMP';


Note : Use the above query in QMF, bcz when i try it in ISPF it was not listed in detail. try and let me know if you need more.
Back to top
View user's profile Send private message
satish1978

New User


Joined: 22 Jun 2006
Posts: 13
Location: mumbai

PostPosted: Thu Jun 22, 2006 12:06 pm    Post subject: db2-cobol
Reply with quote

hi,
i have 4 tables in which first one i have to declare cursor(order table)
three more tables are there(adre,comp,contact) here i can not declare cursor only select statement are there .
my query is first i will perform the first table with using cursor and then i will go to rest three tables with select statement after fetching first record it will again return to the fetch cur sor and agauin check the select statement rest three tables.
please help how can i perform first fetch then perform second(where three tables are there
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Jun 22, 2006 2:56 pm    Post subject:
Reply with quote

I am not able to understand ur requirement...
What do u mean by fetching row from the cursor & then make some select stmt to other table then again u need toi fetch next record from the cursor(how can i perform first fetch then perform second(where three tables are there) ?

Can u please brief me abt ur requirement
Back to top
View user's profile Send private message
satish1978

New User


Joined: 22 Jun 2006
Posts: 13
Location: mumbai

PostPosted: Thu Jun 22, 2006 3:54 pm    Post subject: db2-cobol
Reply with quote

total i have four tables (eu_order,EU_company,EU_CONTACT,eu_address)
level-1 (eu_order)
where we can fetch using cursor co_cd,BR_CD,enD_USER_ID,CONTACT_ID,
total i have four tables
level 2 (eu_contact,eu_company,eu_adress)
now these three tables are at level2 and i am using select statement for these tables(eu_company)
exec sql select end-user_id,EU_nam where end_user_id = from EU_ORDER
then again exec sql (eu_contact)contact_id,end_user_id,Contact_nam,contact_phone,Contact_email
where end_user_id = eu_order, contact_id = Eu_order
eu_address
end_ser_id<eu_street-txt,eu_city_nam where end_user_id =from EU_ORDER


my query is this i will fetch first table that is Eu_order where end_user_id, is common in all four table and after fetchin dcl gen will check second and third and so on so level -1 i declare cursor and level 2 only simple select statement can u help for righting this query
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


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