SoFunction
Updated on 2025-04-14

DB2 gets detailed information on the current user table, fields, index, etc.

DB2 gets detailed information on the current user table, fields, index, etc.

Updated: July 18, 2014 11:09:10 Submission: whsnow
This article mainly introduces DB2 to obtain detailed information on the current user table, fields, index, etc. For those who need it, please refer to it.

Get detailed information on all tables, fields, indexes, etc.

SELECT 

 tbName,
COALESCE(, '') tbDesc,
 columnName,
 columnType ,
decode(,'Y','1','0') notNull,
decode(,'Y','1','0') auto,
 width,
 precision,
COALESCE(, '') comment,
decode(n.unique_colcount,'1','1','0') unique,
decode(,'P','1','0') masterKey,
COALESCE(, '') indexName
FROM
 a
INNER JOIN  d on =
LEFT JOIN  n on = and SUBSTR(colnames,2)=
where 
='T'and ='USERSPACE1'
  • Current user table, field

Related Articles

  • How to access DB2 9 data server on mainframes and minicomputers

    How to access DB2 9 data server on mainframes and minicomputers...
    2007-04-04
  • Detailed explanation of the solution to the problem that the db2 transaction log is full and the log disk space is full

    This article mainly explains the problem of the db2 transaction log full and the log disk space full. The maximum space of the total available activity log in DB2 is limited. When the limit is reached, the log full problem will occur.
    2018-03-03
  • Introduction to IBM DB2 Connect (1)

    Introduction to IBM DB2 Connect (1)...
    2007-04-04
  • Query XML data in DB2 9 using SQL

    Query XML data in DB2 9 using SQL...
    2007-04-04
  • DB2 9 Data Server Development 3 Songs

    DB2 9 Data Server Development 3 Part...
    2007-04-04
  • DB2 programming skills (III)

    DB2 programming skills (III)...
    2007-03-03
  • DB2 UDB V8.1 Management Study Notes (I)

    DB2 UDB V8.1 Management Study Notes (I)...
    2007-03-03
  • DB2 programming skills (VI)

    DB2 programming skills (VI)...
    2007-03-03
  • IBM DB2 Daily Maintenance Summary (I)

    IBM DB2 Daily Maintenance Summary (I)...
    2007-03-03
  • DB2 programming skills (9)

    DB2 programming skills (9)...
    2007-03-03

Latest Comments