Parts of a DQL Procedure

Like a form, report, or menu, a DQL Procedure is a type of DataEase document. A procedure contains many of the same elements as other documents, including the Body, Page Header and Footer, and Summary Header and Footer, that control the appearance of a procedure's printed output. However, a DQL Procedure contains two additional elements that do not appear in a form or report: a script and a Data-entry form. The script appears in the DQL Script Editor window.

This section briefly describes how the various parts of a DQL Procedure fit together.

To open the procedure in Designer View, click once on the MEMBER LIST procedure name in the Catalog, then click on the Designer View button on the Toolbar. DataEase displays the procedure.

 

Script

A script is a set of DQL instructions that DataEase executes when you open a procedure document. A script can ask a question about data in one or more tables, list or manipulate that data, or chain together any number of separate data management operations.

The figure below shows the script for the MEMBER LIST procedure. If you are viewing the MEMBER LIST procedure and the Script Editor is not currently displayed in the active window, choose View - Procedure to activate the Script Editor.

 

image\7dql1-24.gif

The script above tells DataEase:

 

The output generated by this script appears below.

image\7dqli-25.gif

 

Body of a Procedure

When you define a script that generates output, the output is printed in the body of the document. You can create a layout for the body to determine how that output appears when printed.

Creating a layout for a DQL Procedure is just like creating a report layout: you can use DataEase's automatic layout options or you can define a custom layout.

To view a layout on screen, open the procedure in Designer View, then choose View>>Body. The figure below shows the layout for the MEMBER LIST procedure.

 

image\dqli--26.gif

 

DataEase also lets you create a DQL Procedure that does not generate any output. For example, you can create a procedure that simply deletes outdated records, performs an import, backs up the application, or transfers data from one table to another. When you run that procedure, DataEase displays it as a blank screen until the procedure is executed.

 

Page Header and Page Footer

You can enhance the printed output of a DQL Procedure by creating Page Header or Page Footer. Page Headers and Footers appear on each printed page and can contain text, graphics, a page number, the current date, and other useful information.

To view a document Page Header or Page Footer on screen, choose View>>Page Header or View>>Page Footer.

 

image\7dql-27new.gif

 

image\7dql-27.gif

 

To create a Page Header or Page Footer for a DQL Procedure, follow the same steps used to create Page Header or Page Footer for a form or report: choose View>>Page Header, then create the text objects, images, lines, variables, and any other objects you want to include.

 

Summary Header and Summary Footer

image\Dql_0003.gif

See DG 6 for information on creating Summary Variables.

 

You can enhance the printed output of a DQL Procedure by creating a Summary Header or Summary Footer. Summary Headers and Footers appear on each printed page between the Page Header and Footer and the body of the document, and can contain text, graphics, a page number, the current date, and other useful information.

To view a document Summary Header or Summary Footer on screen, choose View>>Summary Header or View>>Summary Footer.

To create a Summary Header or Summary Footer for a DQL Procedure, follow the same steps used to create Page Header or Page Footer for a form or report: choose View>>Summary Header, ( then create the text, images, lines, variables, and any other objects you want to include).

 

The Difference Between Summary and Page Headers and Footers

 

Data-Entry Form

A Data-entry form is a special form that appears at the start of a DQL Procedure. A Data-entry form lets you specify selection criteria and other information used by the procedure before processing begins. For example, a Data-entry form can appear at the beginning of a mailing label printing procedure to let you specify a particular group of customers for whom to print labels.

As originally designed, the MEMBER LIST procedure can list records from only one state, California. By adding a Data-entry form like the one shown in the figure below, you can make the procedure flexible enough to list records for any state.

 

image\7dataentryform.gif

When you use a Data-entry form, you must usually modify the DQL script so DataEase recognizes the input from the Data-entry form. The illustration on the next page shows how the MEMBER LIST script can be modified to work with a Data-entry form.

 

image\Dql_0003.gif

See DQL 2 for information on creating a Data-entry form.

 

The figure below shows the original MEMBER LIST script (above) and the modified version for use with a Data-entry form (below). The modified version tells DataEase to use the selection criterion specified in the Data-entry form instead of a "hard coded" value (e.g., STATE ="CA").

 

image\dqli-30.gif

 

DataEase can automatically redisplay a Data-entry form after you run a DQL Procedure, so you can run that procedure repeatedly, processing a different set of records each time the procedure is executed. The data-entry form appears before the Print dialog, so you could also use it to first print to the screen, then to a printer.