Delete - Delete a Record From a Database

Learn how to delete data from a database.

The DELETE database operation is used to delete existing records in a table. If you do not specify any condition in the "Where Clause" in the instruction, then it deletes all the records.

Example: Delete all the records for the given device ID from the Device Sensor Data Table.

Steps:

  1. Click + under DB Operations to create the new database operation.

  2. Enter the Name of the operation and select Type as "Delete".

  3. Click OK. The new component is created and opened 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 Settings.

  6. Click on Properties > Instruction to open the editor to write the Delete SQL Instruction.
    Image 3

  7. Write down the SQL Instruction in the editor and click OK.
    Image 4

  8. Alternatively, you can leave the Instruction field blank and select an Entity in Properties > Field.
    This auto-generates the DELETE SQL based on the entity schema.
    The input parameters are strongly typed to the target table, such as the names of the parameters must match the field Resource IDs in the entity schema.

  9. Click SAVE to save the configuration.
    Image 5