Construct the SQL Query
The SQL Template Designer supports SQL select statements. You cannot specify UPDATE, DROP, ALTER, or CREATE statements.
To view the available database views and fields that can be used when you create a query, see the
Hitachi Storage Viewer Database Programmer’s Reference Guide. Also, for examples of queries, see
Sample SQL Queries.
1. In the Query window, construct your select statement using the following tips:
• Use the drop-down list at the bottom left of the window to select views and fields.
• Use these lists to look up the valid tables, fields, and variables.
• To insert a view name into a query, double-click a field and then delete the field portion. For example, in the aps_v_database_datafiles_log view, click on datafile_id. Then, in the query, delete the .datafile_id portion.
• Double-click on fields to insert them into the query with the correct syntax.
• Double-click on variables in the list at the right of the window, to insert variables with proper syntax into the query—for example, ${endDate}
• If you checked Host Group and Client Scope in the initial tabbed Template Designer window, you’ll see that the drop-down list of Template Designer Variables (at the right of the window) includes Report Scope selections. Using these selections, you can enumerate a list of values for Host Groups (hostGroups) and Clients (hosts).
• All evaluated columns—for example, nvl(t2.das_capacity,0)—must have an alias name.
2. Click Validate Query.
• Correct the statement before you proceed. Use the available lists to view valid tables, fields, and variables.