Unofficial Content
  • This documentation is valid for:

The Find aggregation function has added important improvements when used with SQL generators. It selects the first value of any model attribute that matches a condition.

Syntax

Find(Att, Cond, Def)

Type Returned: Same as argument attribute
Att: Attribute to find
Cond: Condition to be evaluated
Def: Default value to be returned if the search is unsuccessful

To resolve formula, if the Formula meets the considerations to be optimized, it belongs to the extended table. This means:

  • The formula is resolved in only one navigation, automatically improving its performance.
  • The formula can also be used as an order or filter in any navigation.

The optimization takes place when the matching condition for the formula returns only one record and no default value is set. It means that the complete key of the table where the query is resolved (Departure table) is addressed by means of its Primary or Candidate Key

Notes:

  • If several Find queries can be resolved in the same table with the same conditions, everything is resolved in the same navigation.
  • This feature is supported for all SQL generators.
  • The Specification Report shows which Find is optimized. A READ allowing nulls section between the tables involved is displayed; otherwise, the navigation needed to resolve the Find query is displayed.
  • The Optimize Find Navigation is added to enable or disable the optimization; the default value is Yes.
  • If an attribute is updated in the associated For Each, the optimization is not done. This restriction is solved since GeneXus X.

Scope

Objects:  Transactions, Procedures, Web Panels, Web Components, Master Pages
Languages: Java, .NET, .NET mobile, Visual Basic, Visual FoxPro
DBMS: Oracle, SQL Server, DB2 Universal Database, DB2 UDB for iSeries, PostgreSQL, MySQL, Informix

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant