The getWhereClause Placeholder

Previous Next

 

See Also

The getWhereClause placeholder copies the WHERE clause of another data source, and pastes it into the WHERE clauses in which it is used. Both data sources must be a main data source (not embedded), and also both based on the same table.

 

You can adjust the data source aliases in the WHERE clause by that of another, and also specify a clause (which is by default ‘1=1’) in the case that the specified data source has no WHERE clause at all, as specified by the syntax:

 

 ${getWhereClause(<DataSource name>,<DataSource alias>,<IfNullString>)}

 

The resulting expression from the getWhereClause placeholder includes all parent references of the specified data source, and its outer join clauses from embedded data sources. The latter may also expand the FROM clause of your data source, with the joined (embedded) data sources that belong to the specified data source. It excludes the WHERE clause of the selected record, however.

 

For example, for a MANAGER table on a related page that must have the same WHERE clause as it has on a parent (previous page), you can set the Where Clause property to:

 

 ${getWhereClause(../MANAGER,MANAGER)}

 

If the MANAGER table on the previous page has a WHERE clause with the condition t1.NAME = ‘JOHN’, then the MANAGER table on this page has this condition also, with t1 replaced by its own data source alias.