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

How to fetch only the structure of a DB2 table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 677
Location: NJ

PostPosted: Fri Jun 16, 2006 7:23 pm
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
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: 1208
Location: Bangalore,India

PostPosted: Thu Jun 22, 2006 2:56 pm
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
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 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 Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top