Tivoli Decision Support for z/OS, Version 1.8.1

The SELECT Constraint

By default all the attributes for an attribute group are selected from the table when the query is executed. It is however possible to change the queries SQL SELECT statement by creating a constraint name of SELECT and setting the constraint value to the SELECT statement which you desire.

Note that the value provided in the SELECT constraint is passed directly into the SQL statement which is used against the IBM Tivoli Decision Support for z/OS DB2 database. This means that the attributes referenced in the SELECT constraint value must represent the physical DB2 column names and not the attribute names of the monitoring agent. See Appendix A. Mapping attributes to the Tivoli Decision Support for z/OS DB2 database to view the DB2 table names and column names for all of the monitoring agents corresponding attribute groups and attributes.

Below shows example uses of the SELECT constraint:

SELECT MVS_SYSTEM_ID,DATE,TIME
Select three columns rather than all attributes within the group.
SELECT DISTINCT(MVS_SYSTEM_ID)
Select the distinct or unique MVS System IDs from within the table.
SELECT DATE,SUM(TRANSACTIONS) AS TRANSACTIONS
Here a total sum of all the transactions for each date in the table is returned. Note that when using SQL aggregate functions such as COUNT, SUM, MIN and MAX, the SQL statement will return a null column header. So that the monitoring agent knows what attribute the data being returned is for, you need to use the AS feature to define the column name. Also note that aggregate functions also require a GROUP BY clause, otherwise an SQL error will be returned. See The GROUPBY Constraint for more information on this.

For simplicity in your queries, we recommend you use the SELECT constraint only if you cannot achieve the desired query through use of the filters as described at the top of this chapter.




Feedback

[ Top of Page | Previous Page | Next Page | Contents ]