4D v13.4

QUERY SUBRECORDS

Home

 
4D v13.4
QUERY SUBRECORDS

QUERY SUBRECORDS 


 

QUERY SUBRECORDS ( subtable ; queryFormula ) 
Parameter Type   Description
subtable  Subtable in Subtable to search
queryFormula  Boolean in Query formula

Subtables are no longer supported starting with version 11 of 4D. A compatibility mechanism ensures the functioning of this command in converted databases; however, it is strongly recommended to replace any subtables with standard related tables.

QUERY SUBRECORDS queries subtable and creates a new subselection. This is the only command that queries subrecords and returns a selection of subrecords. The queryFormula is applied to each subrecord in subtable. If the formula evaluates as TRUE, the subrecord is added to the new subselection. When the query is complete, QUERY SUBRECORDS makes the first subrecord the current subrecord of subtable.

Remember that QUERY SUBRECORDS queries only the subrecords of the subtable contained in the currently selected parent record, and not all the subrecords associated with the records of the parent table. QUERY SUBRECORDS does not change the current parent record.

Typically, queryFormula tests a subfield against a variable or a constant, using a relational operator. The queryFormula can contain multiple tests that are joined by AND conjunctions (&) or OR conjunctions ( | ). Also, the queryFormula can be a function or contain a function. The wildcard character (@) can be used with string arguments.

If neither a current record nor a higher-level subrecord exists, QUERY SUBRECORDS has no effect.

Example  

The following example queries for children older than age 10:

 QUERY SUBRECORDS([People]Children;[People]Children'Age>10)

 
PROPERTIES 

Product: 4D
Theme: Subrecords
Number: 108

This command is deprecated and should not be used anymore

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v11 SQL

 
SEE ALSO 

ALL SUBRECORDS
ORDER SUBRECORDS BY
Records in subselection