List all computed columns in Db2 database

Query below lists all computed columns in IBM Db2 database


select tabschema as schema_name,
       tabname as table_name,
       colno as col_no,
       colname as column_name,
       typename as data_type,
       text as generation_expression
from syscat.columns
where tabschema not like 'SYS%'
      and generated = 'A'
order by schema_name,


  • schema_name - schema name containing table
  • table_name - table name
  • col_no - column position in table
  • column_name - name of the column
  • data_type - data type of column
  • generation_expression - computing formula


  • One row represents one generated column
  • Scope of rows: represents all computed columns from all schemas
  • Ordered by schema name, table name and column position

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.