Insert - Insert a Record In a Database

Learn how to perform insert operations on a database.

The Insert operation takes a record as input and inserts that record in a database.


Example: To insert the data into the Device Sensor Data Model Entity.

Steps:

  1. Click + under database operations to create the New Database operation.

  2. Enter the Name of the operation and select type as Insert.

  3. Click OK. The new component is created and displayed in the designer.

    Image 1

  4. Click Edit in the top menu to open the Properties Panel.

  5. Navigate to Properties > Data Source and select the required data source. You can create a new data source such as SQL Data Source under the settings.

  6. Select the name of Entity or Data Model in Properties > Entity. This generates the insert instruction based on the entity schema automatically. The input parameters are strongly typed to the target table, meaning the parameter names must match the field Resource IDs in the entity schema.

    Image 2

  7. If you want to write the instruction (SQL) instead of selecting the Entity, you can write the SQL instruction under Properties > Instruction.

    Image 4

  8. Write down the SQL instruction in the editor and click OK.

    Image 5

  9. Click SAVE to save the configuration.

    Image 6