Wiki source code of Datenbank (SQL Statement)
Hide last authors
author | version | line-number | content |
---|---|---|---|
5.5 | 1 | {{figure image="sql_en.png" width="300" clear="h1"/}} | |
1.1 | 2 | ||
5.5 | 3 | Actions of type //Database query// allow you to write custom SQL queries and execute them against a database. The database connection must have been setup in the [[database connection menu>>Formcycle.UserInterface.Data.DBConnections]]. The SQL statement may contain [[variables>>Formcycle.UserInterface.Variables]]. | |
1.1 | 4 | ||
5.5 | 5 | == Options | |
1.1 | 6 | ||
5.1 | 7 | ; Statement | |
5.5 | 8 | : The SQL statement to be executed. | |
1.1 | 9 | ||
5.5 | 10 | == Note == | |
1.1 | 11 | ||
12 | |||
5.5 | 13 | The statement will be executed as a so called //prepared statement//, which prevents SQL injection attacks. You do not need to use simple quotation marks ({{code language="none"}}'{{/code}}). | |
1.1 | 14 | ||
5.5 | 15 | (% style="color: rgb(56, 118, 29);" %)**Correct** | |
16 | |||
1.1 | 17 | {{code language="sql"}} | |
5.5 | 18 | insert into test_tabelle (firstName, lastName) values ([%tfFirstName%], [%tfLastName%]) | |
1.1 | 19 | {{/code}} | |
20 | |||
5.5 | 21 | (% style="color: rgb(204, 0, 0);" %)**Wrong** | |
1.1 | 22 | ||
23 | {{code language="sql"}} | ||
5.5 | 24 | insert into test_tabelle (firstName, lastName) values ('[%tfFirstName%]', '[%tfLastName%]') | |
1.1 | 25 | {{/code}} |