When you define a sequential search, you can use placeholders to access the values that were returned in the previously executed SQL statements. This is very helpful if you need the ID of the selected row in the next select statement.
For example, to select the buildings in a certain street, you need the ID of this street in the buildings query.
Placeholders are written in {} braces: {X}, where X is the number of the select statement that the result was returned from (index).
The index always begins with 0 (zero). This means that the results of the first query must be accessed with {0}.
Example:
Statement 1:
Select id, name from City order by name;
Result rows for 1:
ID NAME
1 Athens
2 Berne
3 Berlin
Statement 2:
Select id, name from Street where id_city = {0} order by name
In this example, the query for statement 2 depends on the previously selected result, because it contains a placeholder ‘{0}’. When you select the city Berlin, the following query is executed:
Select id, name from Street where id_city = 3 order by name
The index has to be smaller than the number of search queries.