Identifies particular records in an Zim database.
object [WHERE clause] [SORTED BY clause] [KEEP clause]
|object||The name of an EntitySet, relationship, form, application document, or result set. Role names can be used for EntitySets or relationships. Any number of objects can be specified, provided that they are meaningful in context.|
A set specification (sometimes called a setspec) is a statement that uses EntitySets, relationships, forms, application documents, and result sets as the source of the set being declared. Each object in the set specification is called a component. (Result sets can represent more than one component.)
A set specification can also include a condition that limits record selection (WHERE clause), a sorting statement (SORTED BY clause), and a component projection list that limits the number of components in the resulting set (KEEP clause).
Any number of objects can be declared. But, if you declare more than one object, then you must declare the relationships through which records in those objects are associated.
Each object can be further qualified using any valid combination of the following subcommands:
-> (Dynamic rename), COMPLETE, UNRELATED, USING
and in particular circumstances:
INTERSECT, MINUS, UNION
Set specifications are processed, in order, from left to right.
list all Employees
The simplest type of set specification. The set consists of all of the records in the EntitySet Employees.
list all Employees where LastName = “Smith”
Includes a condition for record selection.
list all Employees sorted by EmpNum
Includes a sorting subcommand.
list all Employees where LastName = “Smith” sorted by EmpNum
Combines a condition and a sort.
list all Employees WorkIn Departments
The relationship that defines the association (WorkIn) must be included because two EntitySets are being declared. All associated records in Employees and Departments are included.
list all Employees WorkIn Departments keep Departments
Adds a component projection list. Of associated records in Employees WorkIn Departments, only the (unique) records from Departments are included in the set.
list all Employees (unrelated) WorkIn Departments
The subcommand UNRELATED modifies the relationship; all records in Employees that are unassociated with Departments are included.