SQL Statement
The following chapter provides information about how a SQL database can be connected via a SQL Statement.
To avoid user mistakes or execution of unwanted SQL statements we recommend to use the SQL Table or SQL Procedure connector.
In this section, we want to connect to the previous defined system with the database "fruits_db" and get data by running a SQL Statement. Similar to the "ODBC_Tables" case, we go to the menu item "Functions, Models & Code-Files" and create a new Function under a Category "CAT1", which has to be created before. The Function Data information has to be entered in the standard window as follows:
Function data
The Technical Handler which is able to retrieve data from a relational database defined within a SQL Statement is ODBC_SQL - vx.x.x (latest)
(to be selected in the Function data section of the Function configuration). As usual the other variables and information like the Short Name and the System have to be specified. Please find the general details in the Portal's create a new Function section, also for how to create a Function. Beside the Function data, the following information have to be specified as follows.
Authentication Configuration
In case the "Shared Basic Auth (User and Password)" is configured by the Admin at System level, nothing has to be specified. Otherwise enter the "User" and a "Password" which should be specifically used for this Function.
Technical parameters
The only technical parameter which has to be specified is the STATEMENT. In there, just type in the SQL Statement to be executed. Please note, that not all operations are supported. Aggregation can be achieved as usual by the sum()-operator.
User parameters
In general all Parameters are available and can be applied, if the relational database supports it.
It is also possible to integrate the Parameters dynamically into the SQL statement. However, since the VDP Team does not recommend the execution of SQL Statements directly, it is not documented in detail here. Please contact the VDP Team directly to get further information.