View previous topic :: View next topic
|
Author |
Message |
deepak_nag Warnings : 1 New User
Joined: 16 Jun 2006 Posts: 4
|
|
|
|
How can i fetch only the structure of a DB2 table using query ?
WARNING: TITLE EDITED |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
satish1978
New User
Joined: 22 Jun 2006 Posts: 13 Location: mumbai
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
satish1978
New User
Joined: 22 Jun 2006 Posts: 13 Location: mumbai
|
|
|
|
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 |
|
|
|