How to view DB2 Table structure

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

How to view the table structure in DB2 database

19条回答
  •  北海茫月
    2020-12-24 01:42

    How to view the table structure in db2 database

    Open db2 command window, connect to db2 with following command.

    > db2 connect to DATABASE_NAME USER USERNAME USING PASSWORD
    

    Once you connected successfully, issue the following command to view the table structure.

    > db2 "describe select * from SCHEMA_NAME.TABLE_NAME"
    

    The above command will display db2 table structure in tabular format.

    Note: Tested on DB2 Client 9.7.11

提交回复
热议问题