Creating query parameters
- Click the Query Parameters option in the widget menu. The Parameters grid opens in a dialog.
- Click Add Parameter to create new parameter. Click Delete Parameter to delete rows of existing parameters.
- Specify the Parameter Name.
-
Select one of these options for the parameter type:
- String: Accepts any combination of letters, numbers, special characters.
- Number: Only accepts digits and decimal values.
- Running Date: Only accepts integers which are used to calculate a relative date based on the current date.
- Dynamic Field: Provide any of the below mentioned dynamic fields in upper case as the parameter value for the dynamic field.
Note: The Dynamic Field parameter is applicable from Optiva version 12.14.61.00 onward.Dynamic Fields Description CURRENT_USER_CODE Uses the Optiva user code for the current user. CURRENT_GROUP_CODE Uses the Optiva group code for the current user. CURRENT_LAB_CODE Uses the Optiva Lab code for the current user. Below are some example queries for Dynamic Field:Query Lookup Labels and Query Parameters SELECT FORMULA_CODE, VERSION, OWNER_CODE FROM FSFORMULA WHERE OWNER_CODE = [%1]
Lookup Labels: Formula;Version;Owner
Parameter Type: Dynamic Field
Parameter Value: CURRENT_USER_CODE
This query retrieves the data using the Optiva user code for the current user.
SELECT FORMULA_CODE, VERSION, OWNER_CODE FROM FSFORMULA WHERE GROUP_CODE = [%1]
Lookup Labels: Formula;Version;Owner
Parameter Type: Dynamic Field
Parameter Value: CURRENT_GROUP_CODE
This query retrieves the data using the Optiva Group code for the current user.
SELECT LAB_CODE, PARAM_CODE FROM FSLABTECHPARAM WHERE LAB_CODE = [%1]
Lookup Labels: Lab Code;Param Code
Parameter Type: Dynamic Field
Parameter Value: CURRENT_LAB_CODE
This query retrieves the data using the Optiva Lab code for the current user.
-
Data sent to Query = Current date + Parameter type Running Date value.
If Parameter type Running Date value is negative:Example: If a user enters the running date as -5,Current date : 2019-02-08 10:14:22.000Running date : -5Value sent to query : 2019-02-03 10:14:22.000
-
If the Parameter type Running Date value is positive:
Example : If a user enters the running date as +20 or 20,Current date : 2019-02-08 10:14:22.000Running date : +20Value sent to query : 2019-02-28 10:14:22.000
-
Define the values to be filtered by assigning tokens in the SQL
Where clause.
Query Lookup Label and Parameters SELECT PROJECTMGR, STATUS_IND, PROJECT_CODE, DESCRIPTION, PROJ_CUSTOMER, PROJ_TYPE, PORTFOLIO, PROJECT_CODE AS DR_PROJECT_PROJECT_CODE FROM FSPROJECT WHERE PROJECTMGR =[%1] AND STATUS_IND =[%2] AND LOGICAL_DELETE=0 ORDER BY PROJECTMGR
Lookup Label: Project Manager;Status;Project code;Description;Project Customer;Project Type;Portfolio;DR_PROJECT_Project code
Parameters:- Parameter Type: String
- Parameter Value: JOHNNY
- Parameter Type: Number
- Parameter Value: 200
- Specify the Query and Parameter values in the Query form for testing.
- The test results are displayed in the Query Results tab.
- Set the widget Query Parameters to align the query with the Where [%1] tokens.
- This is the finished result of the query is displayed in the widget as below: