История страницы
...
Insert record Version 11 (Java)
Группа действийAction group: DtabasesDatabases
Описание действия
Добавляет запись (строку) в указанную таблицу БД.
Иконка действия
Параметры
Входные параметры
Контекст БД – Контекст подключения к выбранной базе данных.
Имя таблицы – Имя таблицы в БД.
Данные для вставки – Словарь данных для вставки в таблицу.
Список имен полей первичного ключа – Список имен полей первичного ключа, который будет получен в результате.
Выходные параметры
В результате получаем Список значений первичного ключа, сгенерированных в результате вставки данных для полей.
...
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 |
Особые условия использования
Отсутствуют.
Пример использования
Задача
Подключиться к базе данных и добавить данные в таблицу (столбцы AGENT_NAME, WORKING_AREA, COMMISSION, PHONE_NO и COUNTRY) . Данные: Lucida, Mumbai, 0.13, 077-12346674, USA.
Решение
Воспользоваться действиями "Connect Standard Db", "InsertRecord".
Реализация
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 - Собрать робота, состоящего из действий:
- Настроить параметры для действия "Стандартное подключение".
- Настроить параметры для действия "Insert Record".
В поле "Insert data" указать данные в виде словаря.
В поле "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.