Parameters in SQL Queries

You can include parameters in the SQL queries for your Excel reports. For each query parameter, you can assign a default value. When you generate the report, you are prompted to enter the value of the parameter, or confirm the default value. Alternatively, you can choose to always use the default value, without being prompted by ALM each time you generate the report.

For example, suppose you want to create a report that displays a graph of the number of requirements added to your project over a period of time. You might want to run the report several times, each time for a different period of time. You can avoid the need to create multiple reports by creating a single report with query parameters for the start date and end date of the period. Each time you generate the report, you are prompted to enter the start and end dates for the period.

You first add query parameters to the parameters list. You can add global parameters that are accessible to all queries in a report, or you can add parameters that can only be used in particular queries. After you add parameters to the parameters list, you insert parameters into the query.

Caution:  

  • You cannot use parameters for SQL identifiers, such as a table name or a column name.

  • Parameter values cannot include an SQL statement.

Parent topic: Excel Reports Overview