4D v14.3QUERY BY EXAMPLE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
QUERY BY EXAMPLE
|
QUERY BY EXAMPLE ( {aTable}{;}{*} ) | ||||||||
Parameter | Type | Description | ||||||
aTable | Table |
![]() |
Table for which to return a selection of records, or Default table, if omitted | |||||
* | Operator |
![]() |
If passed, the scrolling bar will not be displayed | |||||
QUERY BY EXAMPLE performs the same action as the Query by Example menu command in the Design environment. It displays the current input form as a query window. QUERY BY EXAMPLE queries aTable for the data that the user enters into the query window. The form must contain the fields that you want the user to be able to query. The query is optimized; indexed fields are automatically used to optimize the query.
See the 4D Design Reference manual for information about using the Query by Example menu command in the Design environment.
The method in this example displays the MyQuery form to the user. If the user accepts the form and performs the query (that is, if the OK system variable is set to 1), the records that meet the query criteria are displayed:
FORM SET INPUT([People];"MyQuery") ` Switch to query form
QUERY BY EXAMPLE([People]) ` Display form and perform query
If(OK=1) ` If the user performed the query
DISPLAY SELECTION([People]) ` Display the records
End if
If the user clicks the Accept button or presses the Enter key, the OK system variable is set to 1 and the query is performed. If the user clicks the Cancel button or presses the “cancel” key combination, the OK system variable is set to 0 and the query is canceled.
Product: 4D
Theme: Queries
Number:
292
Created: < 4D v6
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)
Inherited from : QUERY BY EXAMPLE ( 4D v11 SQL Release 6)