When the properties that are displayed in the Object
List do not provide all the information that you need,
you can create a custom property. For example, you might want to see
the last time statistics were run for the tables in a database. You
can retrieve this information by selecting the STATS_TIME value from
SYSCAT.TABLES table in the DB2® system
catalog.
About this task
You can create custom properties only for databases on DB2 Linux, UNIX, and Windows.
Procedure
To create a custom property, complete the following steps:
- Click
(Arrange the contents). The Property Display Settings window
opens.
- Click Create. The New
Custom Property window opens, which initially contains
a template for the query. For example, the initial query for tables
is:
select TABNAME
from SYSCAT.TABLES
where TABSCHEMA='$(schema)'
and TABNAME='$(name)'
If you want
to see the last time that statistics were run for the tables in the
database, you would change the query to:
select STATS_TIME
from SYSCAT.TABLES
where TABSCHEMA='$(schema)'
and TABNAME='$(name)'
- Specify the name and query for the custom property, and
click OK. The query must not return
more than one row.
Tip: You can specify the versions of
the database that you want the property displayed for. Specifying
versions can be useful when you use multiple versions of DB2 for Linux, UNIX, and Windows. For example, you might want to take
advantage of a new column in a more recent version and do not want
the property to show up for earlier versions.
The Property
Display Settings window opens again. The new property is
displayed at the bottom of the list. By default, it is set to be displayed
in the Object List
What to do next
To edit a previously defined custom property open the Property
Display Settings window, select the custom property, and
click Edit. To delete a custom property, open
the Property Display Settings window, select
the custom property, and clickDelete.