DB query to add records to a database table
Create a DB query to add records to a database table.
-
On the DB query action dialog box of a form, click
Configure.
The DBQuery dialog box is displayed.
-
To specify the database connection string that holds the details of the relational database, select either
Database connection.
-
Local (Default): Select a global variable or click to manually enter the connection string.
-
External: To use the database connection from external storage, enter the secret name for the connection secret stored in the configured external storage.
By default, the Type list displays Tables and all tables within the selected database appear on the Tables list.
-
-
On the
Tables list, select the table to add records.
All columns within the selected table appear under Available columns.
- On the Record list, select Add. (Default: Get)
-
Select the columns and click
to
move the columns from
Available columns to
Selected columns.
Use and on the column header to reorder the columns.
- To map the values to the selected columns, on the Value list of the column, select form control, form/global variable, or field, or click and enter a static value.
- On the Return rows affected to list, select a form control, form/global variable, or field.
-
To insert multiple records in a database table at runtime:
In the Properties panel of the Table control > General tab, ensure the Multi-select and Add and modify properties are selected.
- Select Perform multiple inserts.
-
Select either option:
-
Insert all rows (Default): Inserts all rows for the selected columns.
-
Insert selected rows: Inserts selected rows for the selected columns.
Multiple selection of rows is available only if you create a DB query action on forms. -
- For information on selection criteria and the DB query outcome, see Insert multiple records into a database.
- Click OK.
- The DB query action dialog box displays the query.
- Click Save.