Easy to Create, Easy to Change - Easy to use!

Command::

list records



Parameters


Returns/Result


Examples


Reference

list records

Type

Processing Command

Purpose

The list records command tells DataEase which items to display in the procedure output for each record processed by a script. These items are called list items. Although the most common list item is a fieldname, a list item can also be a constant, a variable, or any other expression you want to include in the report output.

Syntax

for TABLENAME | RELATIONSHIP

[with selection criteria] ;

list records

FIELDNAME |VARIABLE NAME | LITERALS ;|.

end

list records [in FORMNAME | RELATIONSHIP

[named "UNIQUE RELATIONSHIP NAME" ]

[with( selection criteria) ]]

 

Usage

Each list item must be followed by a semicolon except the last, which is followed by a period. To sort, group, or generate statistics on a list item specified in a list records command, insert the appropriate operator after the list item. You cannot list or modify more than 255 fields in a single DQL Procedure.

Example 1

for MEMBERS ;

list records

STATE in groups ;

LAST NAME in order ;

TOTAL DUE : item min max sum .

end

 

 

This script tells DataEase: (1) Process all the MEMBERS records with the same value in the STATE field together as a group, (2) display the group identifier (STATE) once at the beginning of each group, (3) within each group, arrange the members in alphabetical order by LAST NAME, (4) list each member's TOTAL DUE (item), (5) list subtotals of each specified statistic for each STATE group (in groups with group-totals), (6) list the smallest TOTAL DUE (min), (7) list the largest TOTAL DUE (max), and (8) list the sum of all the TOTAL DUE amounts combined (sum). Theoutput might look as follows:

 

 

State

Last Name

Total Due

...

...

...

KY

Bouchard

$100.00

 

Denofsky

$70.00

 

Steiner

$115.00

 

Group Total

$285.00

 

 

 

LA

Orsini

$85.00

 

Rodriguez

$100.00

 

Simpson

$85.00

 

Group Total

$270.00

...

...

...

 

 

Minimum Total Due

$280.00

Maximum Total Due

$35.00

Sum Total Due

$18,190.00

 

Example 2

Although list records is usually used with the for command to list data, you can also use list records to list text literals, values stored in variables, and other values. For example, the script below prints Club ParaDEASE cruise boarding passes. It lists a text literal and values stored in a variable, joined together using the jointext function:

 

define temp "CRUISETICKETNUM" Number .

assign temp CRUISETICKETNUM := 0 .

while temp CRUISETICKETNUM < 1000 do

temp COUNTER := temp CRUISETICKETNUM + 1 .

list records

jointext( " Boarding Pass No. " , CRUISETICKETNUM ) .

end

 

The example above tells DataEase to: (1) Create a temporary variable named CRUISETICKETNUM and to assign it an initial value of zero, (2) evaluate the condition following the word while, and if the value of CRUISETICKETNUM is less than 1000, execute the actions following the word do until the end command, and (3) reevaluate the condition (CRUISETICKETNUM <1000), and if it is still true, repeat the actions until the condition becomes false.

Each time the actions are executed, the list records command tells DataEase to print the text string, "Boarding Pass No.", followed by the current value in the CRUISETICKETNUM variable. Notice that the text string "Boarding Pass No." includes a single trailing space so the ticket number prints in the correct location.

The output for this procedure might look as follows:

Boarding Pass No. 1

Boarding Pass No. 2

Boarding Pass No. 3

Boarding Pass No. 4

See Also


On the forum about list records

On the blog about list records