Hello everybody I am learning DB2 and would like to know how to see a table\'s characteristics after I create one.
Similar to the EXPLAIN TABLE command in MySQL.
<
DB2 Version 11.0
Columns:
--------
SELECT NAME,COLTYPE,NULLS,LENGTH,SCALE,DEFAULT,DEFAULTVALUE FROM SYSIBM.SYSCOLUMNS where TBcreator ='ME' and TBNAME ='MY_TABLE' ORDER BY COLNO;
Indexes:
--------
SELECT P.SPACE, K.IXNAME, I.UNIQUERULE, I.CLUSTERING, K.COLNAME, K.COLNO, K.ORDERING
FROM SYSIBM.SYSINDEXES I
JOIN SYSIBM.SYSINDEXPART P
ON I.NAME = P.IXNAME
AND I.CREATOR = P.IXCREATOR
JOIN SYSIBM.SYSKEYS K
ON P.IXNAME = K.IXNAME
AND P.IXCREATOR = K.IXCREATOR
WHERE I.TBcreator ='ME' and I.TBNAME ='MY_TABLE'
ORDER BY K.IXNAME, K.COLSEQ;