4D v16.3Principles for searching in 4D |
||
|
4D v16.3
Principles for searching in 4D
Principles for searching in 4D
Searching (or "querying") is one of the most common database operations. It is often the most convenient way to select the records with which you want to work. The term searching refers to finding a group of records in the database based on the contents of one or more fields. You perform a search by specifying a query. A query is the set of instructions that tells 4D which records to include in the new current selection, such as “Company Name is equal to 4D.” A query always has three elements: field name, comparison operator, and value. The field name is from the current table or a related table. The comparison operator tells 4D how to compare the contents of the field to the value you specify (equal to, greater than, less than, and so forth). The value specifies the number, string, or other value to which each record is compared. You can perform a query while you are using either an input or an output form. If you perform a query while you are using an input form, the first record in the new current selection is shown in the input form. You can view, modify, or print the record. If the new current selection consists of more than one record, you can move through the records using the navigation buttons (Previous Record, Next Record, First Record, Last Record). If you modify a record before pressing a navigation button, 4D will save the modifications to disk. In relational databases, you can search in fields from other tables, provided that a relation between the tables has been established. If you do the query while using an output form, the new current selection is displayed in the output form. You can reset the current selection to all the records in the current table by choosing Show All from the Records menu. Note: If a field in the database structure is not used in the current database, the database designer can elect to hide the field by giving it the Invisible attribute. Only tables and fields which are visible appear in the Query editor. For more information about this property, refer to the “Attributes” sections of Table properties and Field properties. 4D provides several powerful editors for searching a database. You can use any of the search tools to create a query. Records that meet the condition become the new current selection. In the Design environment, the Records > Query menu as well as the menu associated with the Query button of the 4D tool bar provides four menu commands related to searching. Each menu command displays a different dialog box or window or provides different options. They differ in the types of queries they carry out and the way in which the current selection is displayed. In the Application environment, the windows of these dialog boxes are available via language commands found in the “Queries” theme. These menu commands represent three different search methods:
|
PROPERTIES
Product: 4D
HISTORY
ARTICLE USAGE
4D Design Reference ( 4D v16) |