Definition and Style The style of the TQL is first to isolate the data subset of interest, then to operate on it. By operate, we mean sort it, print it, correlate with it, change it, etc., just about anything you want to do with it. To obtain an isolation there are five isolation spaces, which we call collections. Collection names are A, B, C, D, and E. A collection contains the result of a query. For example: find a where city = seattle and age > 33 will isolate into collection A all records from any table in the database for which the selection criteria "city equals seattle and age greater than 33" is true. Subsequent commands, such as SORT, READ, PRINT, or CHANGE refer to collection A and thus deal only with the subset of interest rather than having to plow through the whole database. The convenience, response, and capabilities of this style will make themselves felt when you are operating on a couple of hundred data records selected from a pile of millions of data records. Structure of a Collection A collection always represents the whole Database. For example, a collection representing a database composed of 10 Tables will have 10 portions to it. Each Table's portion of a collection contains the isolation achieved from that Table. The TALLY command will always show you the current status of a collection. Isolation-type commands (FIND, MATCH, PICK, etc.) put subset representations into a collection. Arranging-type commands (SORT, RELATE, etc.) order and/or combine and order the subsets represented in the collection. Display-type commands (REPORT, etc.) display the results of your isolating and arranging. All of these commands can operate on the collection as a whole, or they can be focused to operate on a particular Table's portion of a collection. For example: sort a by cust# -Sorts all records represented in all of A sort a customers by cust# -Sorts just CUSTOMERS records in A This gives rise to "the most common problem encountered by 1st time users ." Examples of Collections in Use This section presents several examples of collections in use. The CLEAR, PICK, FIND, MATCH, FILL, and RAWPRINT commands are illustrated. You will see that once a collection exists, it can be used as a term or a factor in subsequent query expressions. You will see some variety in syntax that can make up query expressions, including the fact that even though we talk about the FIND command, the word FIND is optional in the syntax. To begin, we insure that collections A and B are cleared from any previous activity that may have involved them. clear a Any previous subset isolations are clear b now cleared from collections A and B Now we want to carefully select two sets of records from the CUSTOMERS table so that there is a known overlap between them. We will put one subset in collection A and the other in collection B. The PICK command selects records by record number so we will use the PICK, and also show the command response that you see if you were doing this by hand. pick a customers 1-7BA 7 records selected pick b customers 4-10 7 records selected Here are two subset selections, one in collection A and the other in collection B. They are picked by record number so there is a known overlap between them. We will study the action of queries below by examining the record numbers in the records that result. Even though these selections were obtained by isolating records 1 thru 7 in A and records 4 thru 10 in B, they could have been anything. Say A was obtained by HAIR_COLOR=RED and B was HANDED=LEFT. Then, in the above illustration box A represents all redheads in the database and box B represents all the left-handed in the database. Where they overlap represents all the records for which both conditions are true, all left-handed redheads. Lets look at these two subsets: rpr/r a name 1 CUSTOMERS SMITH, BOB The RAWPRINT
(rpr) command rpr/r
b name 4 CUSTOMERS STRONG, BARBARA and what
field(s) to print. In Note that records 4, 5, 6, and 4 CUSTOMERS STRONG, BARBARA 1 CUSTOMERS SMITH, BOB 1
CUSTOMERS SMITH, BOB 1 CUSTOMERS SMITH, BOB 8 CUSTOMERS DOE, JOHN 1 CUSTOMERS SMITH, BOB |
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.