How to access Library, File, and Field descriptions in DB2?
I would like to write a query that uses the IBM DB2 system tables (ex. SYSIBM) to pull a query that exports the following:
LIBRARY_NAME, LIBRARY_DESC, FILE_NAME, FILE_DESC, FIELD_NAME, FIELD_DESC
I can access the d开发者_运维问答escriptions via the UI, but wanted to generate a dynamic query.
Thanks.
Along with SYSTABLES
and SYSCOLUMNS
, there is also a SYSSCHEMAS
which appears to contain the data you need. Please note that accessing this information through QSYS2
will restrict rows returned to those objects with which you have some access - the SYSIBM
schema appears to disregard this (check the reference - for V6R1 it's about page 1267).
You also shouldn't need to retrieve this with a dynamic query - static with host variables (if necessary) will work just fine.
精彩评论