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
 

 

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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


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