Friday, 16 May 2014

How to check the state and type from one table

How to check the state and type from one table

Table information: state and type


The Status of the table object is showed below:

  • C = Set integrity pending
  • N = Normal
  • X = Inoperative

The  type of the table is  showed below

TYPECHAR(1)
Type of object.
  • A = Alias
  • G = Global temporary table
  • H = Hierarchy table
  • L = Detached table
  • N = Nickname
  • S = Materialized query table
  • T = Table (untyped)
  • U = Typed table
  • V = View (untyped)
  • W = Typed view
To verify the table status and type, after to connect on database at command prompt type:
db2 "select substr(tabname,1,20) , status, type from syscat.tables \
where tabname = 'table_name'"
You will have something like:
TABNAME              STATUS    TYPE

Table_name             N          T


  1 record(s) selected.

    Using the Syscat.tables you can find much more information like Table Status,  Which tablespaces the tables reside,  table type ,etc.
    Access the URL below and on the search type : syscat.tables to see all options and informations that you can see about tables.

No comments:

Post a Comment