From version < 9.1 >
edited by nlo
on 09.05.2019, 10:03
To version < 6.2 >
edited by awa
on 11.04.2019, 16:44
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.nlo
1 +XWiki.awa
Content
... ... @@ -8,17 +8,14 @@
8 8  
9 9  == Creating a database query ==
10 10  
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) mask for testing the DB query.{{/figure}}
11 +{{figure image="001En.png" width="300"}}
12 +Creating a database query in {{formcycle/}}
13 +{{/figure}}
13 13  
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
15 +* Enter a unique name.
16 +* Select a database connection
17 +* Enter the SQL statement to be executed for the query
19 19  
20 -* Enter the **SQL statement** to be executed for the query in the editor (see [[figure>>||anchor="data_db_query"]]).
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  
24 24  == Using the database query ==
... ... @@ -29,8 +29,7 @@
29 29  http://<server>/formcycle/datenabfragedb
30 30  {{/code}}
31 31  
32 -The servlet URL is displayed beneath the settings (see [[figure>>||anchor="data_db_query"]]).
33 -The following URL parameters are supported:
29 +The following URL parameters are supported.
34 34  
35 35  |=Name of the paramter|=Description|=Required
36 36  |name|Must match the name of the database query.|Yes
... ... @@ -41,7 +41,7 @@
41 41  |varName|Allows you to change name of the JSON response object. If not given, a plain JSON object with the result data is returned.|No
42 42  |delimiter|The delimiter for the placeholder values, see //queryParameter//. Defaults to a comma {{code}},{{/code}}|No
43 43  
44 -When accessing a database servlet from a form, always use the database URL contained in the global object //XFC_METADATA//, see also the [[metadata>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.FormMetadata]]. For example: {{code language="javascript"}}XFC_METADATA.urls.datasource_db{{/code}}.
40 +When accessing a database servlet from a form, always use the database URL contained in the global object //XFC_METADATA//, see also the [[form-specific JavaScript objects>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.FormMetadata]]. For example: {{code language="javascript"}}XFC_METADATA.urls.datasource_db{{/code}}.
45 45  
46 46  Further we recommend you use the script function [[getDataQuery>>doc:Formcycle.FormDesigner.CodingPanel.ScriptTab.AdditionalScriptFunctions.GetDataQuery]], so you do not have to setup the servlet request manually. The result of the database query is returned as //JSON//.
47 47  
Copyright 2000-2024