Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Explain how to configure and use the Default Query Value (DQV) for parameters in VDM, including best practices and an example use case.
What is Default Query Value (DQV)?
The Default Query Value (DQV) is a fallback value used during query execution when no user input is selected for a parameter.
Why Use Default Query Value?
Using a DQV ensures the query still executes with meaningful results even if the user does not actively select any values at run time. It enhances flexibility and can prevent runtime errors due to missing parameters.
Example Use Case:
You have an IN parameter that allows selecting values 7069907, 7143998, and 7144002. If none are selected at runtime, but DQV is set to ('7069907', '7143998','7144002'), the view will still execute using that list.
Video Tutorial:
Steps to Configure and Use Default Query Value
Step 1: Open VDM and Run Your View
Launch VDM and open the View where you wish to use a Default Query Value.
Step 2: Click on Parameters
From the main screen, select Parameters to manage your parameter list.
Step 3: Add or Modify a Parameter
Choose an existing parameter or add a new one where you want to apply a DQV.
Optional Tip: You may enable the Reset on Search option if you want to clear previous selections on each run.
Step 4: Set the Default Query Value
Enter the values to be used when no user selection is made.
Important Notes:
DQV values are directly injected into the SQL statement and do not follow object identifiers (e.g., quotes or parentheses).
Avoid setting both a Default Value and a DQV—the Default Value takes precedence.
Use Reset on Search to prevent stale values from carrying over between runs.
Example Default Query Value Input:
Step 5: Save Changes
Click off the parameter field to ensure the changes are saved properly.
Step 6: Run the View
Run the view without selecting any values and verify that the DQV is used in the executed query.
Example Output:
Parameter Input: None selected
DQV Set:
('7069907', '7143998','7144002')Returned Results: Data for Account_Num
7069907,7143998,7144002
Article Summary
The Default Query Value (DQV) in VDM allows parameters to fall back on predefined values when no user input is provided. This ensures that views execute gracefully and consistently, even when optional parameters are skipped. Avoid combining DQV with standard default values, and use Reset on Search when needed to ensure a clean query state.
Comments
0 comments
Please sign in to leave a comment.