Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get table name from column in DB2?

I need the db2 sql query to find the table/tables from column name. I have the column name but don't have table name which this column belongs to.

like image 718
AAA_king Avatar asked Sep 01 '11 17:09

AAA_king


People also ask

What is Syscat in DB2?

TABLES. Contains one row for each table, view, or alias that is created. All of the catalog tables and views have entries in the SYSCAT.

How do you find the details of a table?

To show table properties in the Properties window. In Object Explorer, select the table for which you want to show properties. Right-click the table and choose Properties from the shortcut menu. For more information, see Table Properties - SSMS.


1 Answers

select TBNAME
    from sysibm.syscolumns
    where NAME = '<column name>'
like image 86
boes Avatar answered Sep 20 '22 12:09

boes