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, click the Help icon.
See Access Help for Database Views.
Refer to examples of queries.
See Sample SQL Queries.
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 the Help 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 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 will 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.
Certain special characters, when used in SQL queries, must be escaped with a backslash so that they can be evaluated as literals. For example, to treat a character as a literal value, use: .
See Special Characters in SQL Queries.
See Example of Using a Special Character as a Literal in a SQL Query.
Click .
Correct the statement before you proceed. Use the available lists to view valid tables, fields, and variables.
Once the query validates, click to proceed to format the SQL template output.