How to get table column nullable or not in DB2

941 Views Asked by At

I have query in DB2 to get table definition / structure

SELECT c.column_name,
       c.column_default,
       c.data_type,
       t.table_name,
       c.character_maximum_length AS LENGTH
FROM sysibm.tables  t
JOIN sysibm.columns c 
  ON t.table_schema = c.table_schema
 AND t.table_name   = c.table_name
WHERE t.table_schema = SCHEMA
  AND t.table_name = TABLE NAME

IN this I want to get column type is Isnullable true or false.

Can any one please help?

1

There are 1 best solutions below

0
On BEST ANSWER

There should be a column, IS_NULLABLE , in the sysibm.columns table.