Previous Topic: Reviewing the ProcessNext Topic: Defining the Dialog


Planning the Dialog

The following query produces a typical report. It also contains an ORDER BY clause that permits control breaks to be specified. For more information on control breaks and ORDER BY, see Step 1: Plan a Report in SQL Mode.

=> --------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR ------------------------------------------------------------------------------- NAME: SALARY_INFO TYPE: QUERY STATUS: PRIVATE DESCRIPTION: ____________________________________________________________ ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. .. ================================ T O P ===================================== 01 SELECT SALARY, 02 DEPT, 03 NAME, 04 ID 05 FROM STAFF 06 ORDER BY DEPT

The plan for this query is to make it into a dialog so that users who execute it can change the sorted order of the output.

Action

To make the preceding query into a dialog, the object of the ORDER BY clause (DEPT) should be a variable and the TYPE should be dialog, as in the following example:

=> --------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR ------------------------------------------------------------------------------- NAME: SALARY_INFO TYPE: DIALOG STATUS: PRIVATE DESCRIPTION: ____________________________________________________________ ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. .. ================================ T O P ===================================== 01 SELECT SALARY, 02 DEPT, 03 NAME, 04 ID 05 FROM STAFF 06 ORDER BY 1?DEPT_____________