SQL-Queries (ContinentsSQL)

This example shows, how SQL queries can be executed in Respix.

In the specification file, row variables ($ for a variable assignment, R: for row) are defined. So for example, the variable Continent has the value Europe in each cell of line 6. These variables can be used by other functions or variable assignment inserted in. The function sqlQuery executes a SQL query, which is specified by a String. The function executes the query on the database connection (see configuration file) and replaces its markup in the sheet with the result of the query. When the query String is interpreted by Respix, the marker $continent is replaced by the (previously assigned) value of the variable continent.
Thus the complete code executed for the SQL query in line 6, column “Population” is select sum(population) from country where continent='Europe';. The result of this query (730074600) is written in the result report.


Input:


Output: