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 descriptions via the UI, but wanted to generate a dynamic query.
Thanks.
Along with
SYSTABLESandSYSCOLUMNS, there is also aSYSSCHEMASwhich appears to contain the data you need. Please note that accessing this information throughQSYS2will restrict rows returned to those objects with which you have some access – theSYSIBMschema 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.