tags:

views:

2153

answers:

4

Hi,

How can we know the description of every column in a table(DB2) through SQL?

My data base is DB2.

Thanks in Advance

A: 

See if this is of any help.

Anton Gogolev
+1  A: 
select 
  tabname,
  colname,
  typename,
  length,
  scale,
  default,
  nulls,
  identity,
  genereted,
  remark,
  keyseq 
from 
  syscat.columns
Peter Miehle
A: 

describe table schema.table_name

DB2 Describe Command

Michael Sharek
A: 

I work on an iSeries DB2 box (v5r4), it is a special flavor of DB2.

If you're on or connecting to an iSeries (AS/400), the link mentioned by Anton is most excellent (sorry, can't vote yet!)

Describe does not work on an iSeries, but will work with DB2 on the other platforms.

V6R1 is out! If you have access to the data provider DLL, it now implements ADO.NET 2.0 (DbProviderFactory, etc). It's backwards compatible with V5R4.
Anthony Mastrean