Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Display only column names of a table in a single row

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Display only column names of a table in a single row
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    Post subject:
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: 6968
Location: porcelain throne

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

http://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    Post subject:
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    Post subject:
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    Post subject: Reply to: Display only column names of a table in a single r
Reply with quote

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

Site Director


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

PostPosted: Wed Aug 22, 2007 11:53 pm    Post subject:
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    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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us