If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
DB2 does know what databases are in its catalog. If you enter "DB2 LIST DB DIRECTORY" or "DB2 LIST DATABASE DIRECTORY", you will see all the databases catalogged on the server both local and remote.
Your original post only wanted to get the database name from the catalog tables. It does not exist there. If you want the size of the database, if your runstats are current, i recently posted a query that would give you the information.
The thing is that each database has its own catalog (in DB2 LUW). So it doesn't make much sense to store the database name in the catalog; it would just be a single value to begin with. The special register CURRENT SERVER - as mentioned by Andy - serves this purpose very well. So why would you want to have it "in a catalog table"?
p.s: LIST DB DIRECTORY shows the database directory known to the instance. That is a level above databases.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development