Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Center SQL not showing Field Names

Status
Not open for further replies.
Aug 2, 2000
325
US
I'm trying to see all the fields in a table. Using ODBC directly is a deadend street, however using the Command Center I can grab the data just fine.
The problem is I don't know all of the fields available to use in the table. And nobody has any documentation!!

If I use SQL:

SELECT * FROM TABLE

I get the records but the field names are not listed. If I use something like SELECT THISFIELD FROM TABLE then the query result will have a field header of 'THISFIELD' -as an example.

Is there a way just to see the fields (Columns)?
 
dschomburg,

please see below.


select tbname, name, coltype, nulls, length, substr(default,1,8) as Default, scale, colno, substr(remarks,1,25) as REMARKS_1_25 \
from sysibm.syscolumns

You will probably want to change to something like

select name
from sysibm.syscolumns
where tbname = .......

Another useful way to do it is to use describe from the db2 prompt

e.g.

db2> describe yourtable

Cheers
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top