QUERY/iX Reference Manual
> Chapter 4 QUERY/iX COMMANDS (cont)LIST |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
SyntaxL[IST] [data base name:] {data set name | data item list} [FOR relation [{AND | OR} relation]...] [END]For example: >LIST LABOR FOR BADGE# IE "09.18" AND F-NAME IE JOEWhere data set name = LABOR, relation = BADGE# IE "09.18", and relation = F-NAME IE JOE >LIST BADGE#,F-NAME,L-NAMEWhere data item list = BADGE#,F-NAME,L-NAME >L LABORWhere data set name = LABOR Parameters
DiscussionThe maximum number of logical connectors (AND, OR) which can be used in the LIST command is 10. Refer to "Logical Connectors" under the FIND command. The LIST command prints all or a subset of the data item values from a single data set. It is one of the simplest ways to report on your data since you do not need to design a report or specify the format and headings. LIST always uses a serial read. Listing FormatThe data is printed in columns. The width of the columns (or fields) is determined by the data item type. Table 4-2 "Field Widths of Data Item Types" summarizes field widths. QUERY provides two spaces between the fields. Data item names are printed as column headings at the top of each page. If the complete data item name is longer than the field width, it is truncated. Headings of character type data items are left-justified and numeric types are right-justified. If all of the data you request does not fit on one line (in one record), data items at the end of the data item list or the data entry are ignored. The line length varies with the device you are using. It is usually 72 to 80 characters for a terminal and a maximum of 136 characters for a line printer. Table 4-2 Field Widths of Data Item Types
Listing a Subset of the DataYou can list a subset of the data in three ways:
Determining the Data Set to be UsedIf you use the LIST command form specifying a data set name, there is no ambiguity as to which information will be listed. If you use a data item list, you should consider the following:
The Relation of LIST and FINDThe entries selected by the LIST command are not available for any other purpose except the output of this command. The entries selected by the most recent FIND command are unaffected by LIST and are still available for use with UPDATE and REPORT commands. ExamplesExample 1 In the example below, QUERY could not locate the required entry until the value was entered with the correct spacing. >L CUSTOMER FOR STREET-ADDRESS=" 868 DOYLE ROAD" >L CUSTOMER FOR STREET-ADDRESS="868 DOYLE ROAD" ACCOUNT LAST-NAME FIRST-NAME IN STREET ADDRESS 10034765 SLATER GENEVA K 868 DOYLE ROADExample 2 In the next example, the data item values for INVENTORY with STOCK# equal to 6650D22S are listed. >L INVENTORY FOR STOCK#=6650D22S STOCK# ONHANDQTY SUPPLIER UNIT-COS LASTSH BIN 6650D22S 5306 ACME 1427 120385 3 6650D22S 600 HEWLETT-PACKARD 12500 111585 3 6650D22S 3 H & S SURPLUS 0 121585 0 6650D22S 999 H & S SURPLUS 1500 120585 0 6650D22S 13 H & S SURPLUS 1445 121485 3Example 3 In this example, the data item values for SALES with STOCK# equal to 6650D22S are listed. >L SALES FOR STOCK#=6650D22S ACCOUNT STOCK# QUANTI PRICE TAX TOTAL PURCH- 24536173 6650D22S 3 598 20 0 120885 24566356 6650D22S 1 12500 750 0 121585Example 4 This example lists CUSTOMER entries with ACCOUNT greater than 55555555. >LIST CUSTOMER FOR ACCOUNT GT 55555555 ACCOUNT LAST-NAME FIRST-NAME IN STREET-ADDRESS 76623455 MCFALL JEFFEREY X 6650 MONTEREY RD 74001813 FIELD HUBERT J 4556 GEARY 87654321 JONES JOHN P 1 PINE AVEExample 5 Since all the values of each entry in the previous example do not fit on one line, this example lists by the data item names in order to get the items at the end of each entry. >LIST LAST-NAME,STREET-ADDRESS,CITY,STATE FOR ACCOUNT GT 55555555 ACCOUNT IS A MEMBER OF THESE SETS: CUSTOMER,SALES WHICH SET DO YOU WISH TO USE? >>CUSTOMER LAST-NAME STREET-ADDRESS CITY ST MCFALL 6650 MONTEREY ROAD CARMEL CA FIELD 4556 GEARY CUPERTINO CA JONES 1 PINE AVE CAMPBELL CAExample 6 This example lists all STOCK# in the data set INVENTORY. >LIST STOCK# STOCK# IS A MEMBER OF THESE SETS PRODUCT,SALES,INVENTORY WHICH SET DO YOU WISH TO USE? >>INVENTORY STOCK# 6650D22S 2457A11C 3586T14YExample 7 Since QUANTITY is in the SALES data set and is part of the first relation, SALES data set STOCK# values are printed. SALES is automatically added to the data set list. >LIST STOCK# FOR QUANTITY IGT 2 AND ACCOUNT ILT 88888888 STOCK# 6650D22S 3586T14Y 5405T14F 7892Z43YExample 8 SALES and INVENTORY are both in the data set list so QUERY must prompt you for the data set. >LIST STOCK# STOCK# IS A MEMBER OF THESE SETS SALES,INVENTORY WHICH SET DO YOU WISH TO USE? >>INVENTORY 6650D22S 2457A11C 3586T14Y 5405T14F 6650D22S 7892Z43R
|