How to view DB2 Table structure

后端 未结 19 2517
深忆病人
深忆病人 2020-12-24 00:59

How to view the table structure in DB2 database

19条回答
  •  鱼传尺愫
    2020-12-24 01:25

    The OP doesn't mention if this is DB2/400 being discussed, but I found that the only way I could get the table structure including the column name descriptions was to use DSPFFD.

    DSPFFD FILE(TBNAME) OUTPUT(*OUTFILE) OUTFILE(SOMELIB/TBDESC)

    This puts the description of TBNAME in a table called TBDESC in the SOMELIB library. You can then query that with:

    select * from SOMELIB/TBDESC

提交回复
热议问题