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

Display only column names of a table in a single row


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Himanshu Khatri

New User


Joined: 11 Jun 2007
Posts: 15
Location: Pune

PostPosted: Wed Aug 22, 2007 1:05 pm
Reply with quote

Hi,

I have to display only column names of a table in a single row.

I searched in SYSIBM tables but not able to find it.

Can anybody send me query for this in DB2???

TIA icon_smile.gif

Thanx & Regards,
Himanshu
Back to top
View user's profile Send private message
bosalting

New User


Joined: 02 Jun 2007
Posts: 4
Location: Philippines

PostPosted: Wed Aug 22, 2007 1:16 pm
Reply with quote

I usually deal with such need by issuing a SELECT * on the table
in QMF. Then pressing F9 to view the report which gives a list of all column.

Hope this can help.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 22, 2007 1:50 pm
Reply with quote

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/E.4?DT=20010718164132
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 22, 2007 2:00 pm
Reply with quote

Dick,

Seems like he need to get the columns name in a single row!

Thanks,
Prajesh
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Wed Aug 22, 2007 4:52 pm
Reply with quote

select * from <table name> where 1=2


We can give any wrong logical condition in where clause...
Back to top
View user's profile Send private message
Himanshu Khatri

New User


Joined: 11 Jun 2007
Posts: 15
Location: Pune

PostPosted: Wed Aug 22, 2007 10:18 pm
Reply with quote

Thanks guys icon_lol.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 22, 2007 11:53 pm
Reply with quote

Quote:
select * from <table name> where 1=2
We can give any wrong logical condition in where clause...


Good one - better than a fancy "trick" icon_smile.gif

d
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
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 How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top