1

We have a db2 database at our company, and I'm trying to view tables in a schema by their shorter system name instead of by their long name. Is there any way to do this? If I'm in the SQL editor, i can get the short/system name to autofill for table names, but they won't show up in the data source explorer.

Sometimes I'm given a table to look up, and I don't know what the long name of the table is, so I can't find it. The search feature doesn't seem to find it, and the filter options don't find it either.

Any ideas?

4

1 回答 1

1

我没用过 RAD,但总有SYSIBM.SYSTABLES目录视图

我猜测“短名称”实际上是指该表的表空间,可以在目录视图中找到,如下所示(TYPE = 'T'只会返回基表):

SELECT RTRIM(CREATOR) || '.' || RTRIM(NAME)
FROM SYSIBM.SYSTABLES
WHERE TSNAME = 'short_name'
  AND TYPE   = 'T'

通常,除非您指定一个现有的表空间,否则 DB2 会隐式地为该表创建一个新的表空间,因此一个表空间中可能会有多个表。查看下面的CREATE TABLE条目以IN DATABASE获取更多信息。

于 2012-08-28T15:39:05.957 回答