... |
... |
@@ -8,16
+8,32 @@ |
8 |
8 |
|
9 |
9 |
== Creating a database query == |
10 |
10 |
|
|
11 |
+ |
|
12 |
+ |
|
13 |
+* Für die Datenbank-Abfrage selbst, werden folgende Daten benötigt: |
|
14 |
+** **Name**: Name der Datenbank-Abfrage |
|
15 |
+** **Beschreibung**: Eine optionale Beschreibung der Datenbank-Abfrage |
|
16 |
+** **Verbindung**: Die [[DB-Verbindung>>doc:DBConnections]], die verwendet werden soll |
|
17 |
+ |
|
18 |
+* Die eigentliche **SQL-Abfrage** wird im Editor in der Mitte einegeben (siehe [[Abbildung>>||anchor="data_db_query"]]). |
|
19 |
+ |
|
20 |
+Das eingegebene Statement wird als //Prepared-Statement// ausgeführt, so dass keine sogenannte //SQL-Injection// moglich ist. Verwenden Sie daher auch keine Hochkommas. Prinzipiell können auch Übergabeparameter verwendet werden. In der Abfrage setzen Sie an die Stelle des Übergabeparameters ein Fragezeichen {{code}}?{{/code}}. |
|
21 |
+ |
|
22 |
+ |
|
23 |
+ |
|
24 |
+ |
11 |
11 |
{{id name="data_db_query"/}} |
12 |
|
-{{figure image="data_db_query_de.png"}}Configuration screen for creating a database query in: (1) list of existing DB queries, (2) editor for defining the SQL query, (3) settings of the DB query, (4) console for testing the DB query.{{/figure}} |
|
26 |
+{{figure image="data_db_query_de.png"}}Configuration screen for creating a database query in: (1) list of existing DB queries, (2) editor for defining the SQL query, (3) settings of the DB query, (4) mask for testing the DB query.{{/figure}} |
13 |
13 |
|
14 |
14 |
* Open the module "Database queries" and click "New" {{ficon name="plus-circle-outline"/}} in the header of the list (see [[figure>>||anchor="fig_data_db_query"]]). |
15 |
|
-* The following data is needed for a Database query: |
16 |
|
-** **Name**: A unique name for the database query |
17 |
|
-** **Description**: An optional description for the database query |
18 |
|
-** **Connection**: The [[Database connection>>doc:DBConnections]] that should be used |
|
29 |
+* Für die Datenbank-Abfrage selbst, werden folgende Daten benötigt: |
|
30 |
+** **Name**: Ein eindeutiger Name der Datenbank-Abfrage |
|
31 |
+** **Beschreibung**: Eine optionale Beschreibung der Datenbank-Abfrage |
|
32 |
+** **Verbindung**: Die [[DB-Verbindung>>doc:DBConnections]], die verwendet werden soll |
19 |
19 |
|
20 |
|
-* Enter the **SQL statement** to be executed for the query in the editor (see [[figure>>||anchor="data_db_query"]]). |
|
34 |
+* Enter a unique name. |
|
35 |
+* Select a database connection |
|
36 |
+* Enter the SQL statement to be executed for the query in the editor (see [[figure>>||anchor="data_db_query"]]). |
21 |
21 |
|
22 |
22 |
The entered SQL statement is executed as a prepared statement, which prevents SQL injection attacks. You should not and need not use inverted commas (` or '). Also, you can use question marks ( ? ) as placeholders to build queries dynamically. |
23 |
23 |
|
... |
... |
@@ -49,8
+49,8 @@ |
49 |
49 |
|
50 |
50 |
If you want to display the returned data as options of a [[selection element>>doc:Formcycle.FormDesigner.FormElements.Selection]], you can do so easily by opening the {{designer/}} and selecting the database query as the data source of the selection element. |
51 |
51 |
|
52 |
|
-{{figure image="data_db_query_designer_en.png"}} |
53 |
|
-Using the result of a database query as the data source a select element in the {{designer case="dat"/}}. |
|
68 |
+{{figure image="002En.png"}} |
|
69 |
+Setting up a selection element with data from a database query. Just select the database query as the data source. |
54 |
54 |
{{/figure}} |
55 |
55 |
|
56 |
56 |
The result of the database query is used to create the options of the [[selection element>>doc:Formcycle.FormDesigner.FormElements.Selection]] in the following order: |