While writing a program that interfaces Java and DB2 over the JDBC Driver, I attempted to write a program that would retrieve all data (all records contained in all tables) in a given database. When I ran the program, I found that it mostly worked. However, there were several tables that it did not collect data from. I accessed these tables from IBM's bundled Command Editor and found that they contained data. I ran
SELECT * FROM SYSCAT.COLUMNS WHERE TABNAME='Table'
against the database and found that these tables had no column records in the SYSCAT.COLUMNS table. Believing that I misspelled that table name, I ran
SELECT * FROM SYSCAT.COLUMNS
against the database and manually looked for the table under TABNAME. I could not find it. When I ran
SELECT * FROM SYSCAT.TABLES
I found the table in the list of available tables. However, in SYSCAT.TABLES, I also found that none of the tables of TYPE 'A' had any records in SYSCAT.COLUMNS. I was wondering what IBM's reasoning for this is, and how I can find out what the field names are for these particular types of tables.
TL;DR How do I get column names for DB2 without using SYSCAT.COLUMNS through a standard SQL query to a DB2 database?