Kore Tech Tip
How to Build Queries Using wIntegrate
Tip
#1003

Cool wIntegrate Query Builder Techniques

Let’s say that you want to use the wIntegrate Query Builder to create a new query. Building a query is simple enough, but what you really want to do to allow users of the query to specify the records to be included in the report based on criteria they enter when they run the report. Easy!

We’ll illustrate the technique by describing the process of selecting records by Date Range, i.e. when you run the Query it will prompt for the Beginning and Ending Dates, which will then be used to limit the records being reported. Our approach will be to modify an existing report that has a hard-coded date range in its definition.

First, bring up your Query report and click the button to bring up the “Selection of Items” window. Then do the following:

 
  1. In the bottom of this window Double-Click the beginning date Criteria (right now it looks something like “DATE >= “01-01-2002”)
  2. In the top of this Window, you should see the DATE Field highlighted, the >= Operator highlighted, and the Value 01-01-2002 highlighted.
  3. Change the Value from the actual beginning date to <> (should be surrounded by quotes when report is run). It is the double greater than and less than symbols that cause wIntegrate to prompt the user for data and the Literal contained within those symbols to be the prompt field name.
  4. Make the same change for the ending date Criteria (which right now looks something like “AND DATE <= “12-31-2002”). I’d change that 12-31-2002 to something like <>.
  5. Now run the Query. It will immediately bring up 2 prompts, one for Begin Date and one for End Date. Enter the date range and the report will run.

(Note: There is no error checking on data entered.)

Now, let’s add a wIntegrate Queries pull down menu to the menu bar at the top of your wIntegrate Window. It’s simple to set up, and so much better than choosing the menu, clicking the Query Builder choice, and Opening your Query report.

Get going by starting up your wIntegrate session and logging on. Then, do the following:

 
  1. Click on the pull down menu.
  2. Click on the “Preferences” choice.
    This brings up the “Preferences” window.
  3. Click on the ‘Toolbars’ tab.
    You should see that “queries” is one of the choices.
  4. Click on it to place a check-mark beside it.
  5. Click and you will see some new choices on your toolbar: A pull-down list of Queries, a “Run Selected Query” button, a “Run the Query Builder” button, and a “Batch Queries” button.

To execute a Query Report, simply find it in the list, click on it, and click the Run Selected Query button.

UniData and UniVerse are products, copyrights and trademarks of Rocket Software
 
 
 
Our technical tips are provided to help you find new or easier ways to solve some of your technical challenges or to show you a new technique. We hope you find them useful. Please contact us if you would like to share one of your Tech Tips or need help solving a technical challenge. We would be happy to help you.