Insert record Version 11 (Java)
Action group: Databases
Description
The action adds the text (string) in the given DB table.
Action icon
Parameters
Input parameters
DB context – connection context to the selected database.
Table name – table name in DB.
Insert data – data in the form of a dictionary for insertion into a table.
List of primary key field names – list of primary key field names to be returned.
Output parameters
As a result we get the list of primary key values generated when inserting data for the field.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
DB context | Connection context to the selected database | Robin.DbContext | Database context | Yes |
Table name | Table name | Robin.String | Yes | |
Insert data | Data in the form of a dictionary for insertion into a table | Robin.Dictionary | Yes | |
List of primary key field names | List of primary key field names to be returned | Robin.Collection | No | |
Results | ||||
List of primary key values | List of primary key values generated as a result of inserting data for the fields specified in the «List of primary key field names» parameter | Robin.Dictionary |
Special conditions of use
None.
Example of use
Task
Connect to the database and add data to the table (company_name and inn columns). Data: ООО "Ромашка", 5047053423
Solution
Use the "Connect Standard Db", "InsertRecord" actions.
Implementation
- Assemble a robot scheme consisting of actions:
Set the parameters for the "Connect Standard Db" action.
In the "DATABASE TYPE" field, select the appropriate database to which you want to connect.
Specify the database login and password.
The server host can be specified either by the IP of the host where the database is installed or by the host name.
Specify the server port, as well as the database name.
In the "Timeout" field, the value is calculated in seconds.
In the "Parameters" field specify additional parameters for connection, usually these are parameters that relate to security. Parameters are specified in the form of a dictionary.Read more about the "Transaction isolation level" parameter. The sequential database operations can be divided into transactions. A transaction is a group of operations that represent a certain boolean unit of working with the database. For example, it is necessary to perform several operations with a table in order to update the data in it. If an error occurs, you can roll back the transaction, i.e. a group of operations made, so that you do not have to figure out at what step this error occurred.
If the checkbox "Transaction isolation level" is activated, part of the performed queries to the database will be in the form of transactions.
- Set the parameters for the "Insert record" action.
In the "Insert data" field specify data in the form of a dictionary.
In the "List of primary key field names" field fill in the following manner: - Click the "Start" button in the top panel.
Result
The program robot completed successfully. New text inserted in the table.