| sampling | Index Level | selection criteria |
| Syntax | select file.reference {itemlist} {sellist} {outlist} {modlist} |
| Category | Access |
| Type | Verb |
| Description |
retrieves all items from the specified file.reference that meet the optional selection criteria.
The items are selected in the order of their appearance in the file.reference. The selected item may be saved for future use or acted upon immediately. When an "output" list appears in a select-class statement, the list is built from the contents of the specified attribute(s). If an itemlist is specified, items are selected in the order of the item-ids in the itemlist. If no itemlist is specified, all items in the file are considered. In this case they appear in order by the group into which they hash, and within groups, in the order they were added to the file. If output specifications are included, the values of the specified attributes are used to form the list. If omitted, the list is formed from the item-ids. The list is a temporary list that is used by the next verb as its implicit itemlist. The list can be permanently saved by using the "save-list" or "sl" verb. The list can also be passed to an OP command or to a FlashBASIC program if the next TCL command executes that program. The elements of the list may be used as item-ids to reference data in any file, not just the file referenced in the select command. For example, if a select on one file is followed by a list on a different file, the list of item-ids generated by the select are used as an itemlist in the list command. The "outlist" parameter specifies the attribute-defining item{s} from which values are to be extracted for creation of the list. (See example 2.) This is somewhat similar to using "qselect", with the additional provision for being able to specifiy collation order and selection criteria. |
| Options |
j Suppresses all messages.
q Bypass index selection. s Activates a "secondary" list. |
| See Also | secondary list el delete-list active list secondary list selection processor wselect sort-list copy qselect edit-list READNEXT get-list readnext nselect copy-list readnext modlist sselect sellist selection criteria itemlist save-list end compare-list Access verbs sel BEGIN WORK |
| Example |
select invoices with amount.due > "0"
This builds a list of the item-ids which match the given selection criteria. select customers with last.order.amount > "1000" order.pointers This creates a non-sorted list of the contents of the "order.pointers" attribute. sselect invoices = 'd]' with invoice.date ge "1/1/94" by date This creates a sorted list of all invoices whose item-id begins with the letter "d" and with an "invoice.date" on or after January 1, 1994. |
| Warnings | In D3 systems, if "by" is provided with a verb that does not "naturally" sort (such as the "select" verb), the verb is changed to its "sorting" counterpart. (e.g. "select" becomes "sselect", etc.) This does NOT work, however, on R83 releases. |
| Compatibility | D3 7.0 AP R83 |
| sampling | Index Level | selection criteria |