Update records in a database table

Configure a query to update database records.

Before you begin
To use the Data access activity, you must create a process variable to hold the database connection string. For example, create a process variable, with the following settings:
  • ID = DBConnectionString
  • Type = String
  • Value = DSN=TotalAgility

Procedure
  1. On the properties panel of the Data access activity, select Configure.
    The Data access configuration - <Activity name> dialog box is displayed.
  2. You can select one of the following for Database connection.
    • Local (Default): Select the process or server variable to specify the database connection string that holds the details of the relational database.
    • External: To use the database connection from external storage, enter the secret name for the connection secret stored in the configured external storage.

    A list of schema that the database user has permission to access is displayed.

  3. On the Schema list, select a database schema to use for retrieving database objects.

    If no schema is selected, the system uses the default schema for the database user (typically dbo for SQL Server).

  4. On the Type list, select Tables.
    By default, Tables is selected and all tables within the selected database are available on the Tables list.
  5. On the Tables list, select the table for which you want to update the records. All columns within the selected table appear under Available columns.
  6. On the Record list, select Update.
  7. On the Available columns list, select the columns and select .
  8. To perform multiple updates, select Perform multiple updates check box.
    This option is available only if you create a DB query action on a form.
  9. On the Return rows affected to list, select a variable.
  10. Configure your query based on specific conditions. For example, to update the ContactName, Address, and Phone records for the cities of London and Berlin, do the following:
    1. Select under Search criteria.

    2. Specify the search criteria as Column as City(String), Operator as equals, Criteria as London, and Logic as AND.

    3. Select Add.

    4. Select .

    5. Specify another search criteria as Column as City(String), Operator as equals, Criteria as Berlin, and Logic as AND.

    6. Select Add.

  11. Select OK.