DB query to delete records in a database table

Create a database query to delete records from a database table.

  1. On the DB query action dialog box of a form, click Configure.
    The DBQuery dialog box is displayed.
  2. 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.

  3. On the Tables list, select the table for which to delete the records.
  4. On the Record list, select Delete. (Default: Get)
  5. Configure your query based on some specific conditions. For example, to delete the records for the cities of London and Berlin, specify the Search criteria as follows:
    1. Click .
    2. On the Column list, select a column, such as City(String).
    3. Set the Operator as equals (default).
    4. For Criteria, select a form control, variable (form/global), or field.

      Select Null to keep the criteria empty.

    5. Set the Logic as AND.
    6. Click Add.
  6. For Return rows affected to, select a form control, variable (form/global), or field.
  7. Click OK.

    The DB query action dialog box displays the Query.

  8. Click Save.