SELECT tabname, colname, typename, length, SCALE,
CASE
WHEN typename IN ('DECIMAL') THEN typename || '(' || LENGTH || ',' || SCALE || ')'
WHEN typename IN ('VARGRAPHIC') THEN typename || '(' || LENGTH || ')'
ELSE typename
END AS colType
FROM syscat.columns
WHERE tabschema = '你的Schema' AND tabname = '你的表名'
ORDER BY COLNO
DB2: 查询某个表所有字段的数据类型
于 2024-04-11 17:16:26 首次发布