IBM Support

How to list row-orgnized or column-organised tables in DB2 V10.5 onwards.

Technical Blog Post


Abstract

How to list row-orgnized or column-organised tables in DB2 V10.5 onwards.

Body

We can use SYSCAT.TABLES and TABLEORG column under same .

TABLEORG     CHAR(1)           
    C = Column-organized table
    R = Row-organized table
    N = Not a table


To list row organized Tables:
db2 "SELECT substr(tabschema,1,20) AS tabschema,substr(tabname,1,40) AS tabname FROM syscat.tables WHERE  tableorg='R' AND tabschema NOT LIKE ('SYS%')"

To list column organized Tables:
db2 "SELECT substr(tabschema,1,20) AS tabschema,substr(tabname,1,40) AS tabname FROM syscat.tables WHERE  tableorg='C' AND tabschema NOT LIKE ('SYS%')"

 

Reference:https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0001063.html

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm13286317